ToollyX
no sign-up ยท instant ยท free

HTML Encoder & Decoder

Encode text into HTML entities or decode entities back to readable text, with named, decimal, and hex styles, plus a searchable reference table. Runs entirely in your browser.

ENTITY STYLES3 (named/dec/hex)
DECODES2,000+ entities
REFERENCESearchable table
PROCESSEDBrowser-local
UPLOADOptional
728 ร— 90 โ€” Leaderboard Ad
Mode:
Entity Style:
Enter HTML
Encode quotes
Escape " and ' โ€” needed when the text is going inside an HTML attribute
Encode forward slash
Extra defensive convention against premature tag closing โ€” not required by the HTML spec
Encode non-ASCII characters
Also convert accented letters, symbols and emoji for maximum legacy compatibility
Convert line breaks to <br>
Insert a literal <br> at every line break, for direct display as HTML
โœ๏ธ
Plain HTML Input
โšก
Encoded Output
๐Ÿ“–
HTML Entity Reference
CharacterNamedNumericDescription
&&amp;&#38;Ampersand
<&lt;&#60;Less than
>&gt;&#62;Greater than
"&quot;&#34;Double quote
'&#39;&#39;Single quote / apostrophe
ย &nbsp;&#160;Non-breaking space
ยฉ&copy;&#169;Copyright
ยฎ&reg;&#174;Registered trademark
โ„ข&trade;&#8482;Trademark
โ‚ฌ&euro;&#8364;Euro sign
ยฃ&pound;&#163;Pound sign
ยฅ&yen;&#165;Yen sign
ยข&cent;&#162;Cent sign
โ€“&ndash;&#8211;En dash
โ€”&mdash;&#8212;Em dash
โ€ฆ&hellip;&#8230;Horizontal ellipsis
โ€˜&lsquo;&#8216;Left single quote
โ€™&rsquo;&#8217;Right single quote
โ€œ&ldquo;&#8220;Left double quote
โ€&rdquo;&#8221;Right double quote
ยซ&laquo;&#171;Left angle quote
ยป&raquo;&#187;Right angle quote
โ€ข&bull;&#8226;Bullet
ยฐ&deg;&#176;Degree sign
ยฑ&plusmn;&#177;Plus-minus
ร—&times;&#215;Multiplication sign
รท&divide;&#247;Division sign
โ‰ &ne;&#8800;Not equal to
โ‰ค&le;&#8804;Less than or equal
โ‰ฅ&ge;&#8805;Greater than or equal
โ†&larr;&#8592;Left arrow
โ†’&rarr;&#8594;Right arrow
รฉ&eacute;&#233;Lowercase e acute
รฑ&ntilde;&#241;Lowercase n tilde
รผ&uuml;&#252;Lowercase u umlaut
รง&ccedil;&#231;Lowercase c cedilla
ฮฑ&alpha;&#945;Greek alpha
ฯ€&pi;&#960;Greek pi
โˆž&infin;&#8734;Infinity
Full Unicode Decoding, Not a Handful of Entities
Decoding runs through the browser's own HTML parser, which correctly resolves every one of the 2,000+ named entities HTML5 defines โ€” not just the common half-dozen a hand-written table would cover โ€” plus every decimal and hex numeric form, with zero maintenance needed to stay accurate.
728 ร— 90 โ€” Leaderboard Ad

A Quick Gut-Check on the Settings

  • Leave Entity Style on Named for anything a person will read later โ€” &mdash; is instantly recognizable, &#8212; isn't.
  • Only turn on Encode Non-ASCII Characters for legacy or unknown-encoding targets โ€” for anything modern it just makes readable output harder to scan for no real benefit.
  • Remember this handles text-node escaping specifically, not attribute values, not JavaScript strings, not URLs โ€” each of those needs its own escaping approach.
  • Search the reference table by description, not just by symbol, if you know what you want ("em dash", "copyright") but not its exact entity name.

Features

Three entity styles
Named, decimal, and hexadecimal โ€” pick whichever your target system expects.
Full-spectrum decoding
Resolves any of HTML5's 2,000+ named entities plus every numeric form.
Unicode-safe encoding
Emoji and other astral characters encode as one correct entity, not broken halves.
Searchable reference table
Browse or search common entities, click any row to copy it instantly.
Optional line-break handling
Convert plain-text line breaks into literal <br> tags for direct display.
100% browser-based
Every conversion runs client-side โ€” nothing you paste ever leaves your device.

Five Characters Do Almost All the Work

HTML has exactly one character that always needs escaping in ordinary text content: <, because it's the only one a browser's parser treats as the start of something structural rather than literal text. Everything else this tool touches by default โ€” >, &, and (when the switch is on) quotes โ€” is escaped by convention rather than strict requirement, for symmetry and as a safety margin against contexts where it does matter, like inside an attribute value. That distinction is worth understanding rather than memorizing: it's why turning Encode Quotes off doesn't produce broken output for plain text-node content, but would for text about to be dropped into an unquoted HTML attribute.

It's also worth being precise about what "encoding" means here versus in other tools with similar-sounding names. This is character substitution โ€” every unsafe character is replaced with a longer, safe textual stand-in, and the result is still plain text, just longer and uglier to read directly. That's a different operation from Base64 encoding, which represents arbitrary binary data as text for transport, or from compression, which shrinks data. All three get called "encoding" in casual conversation, and confusing them is an easy mistake when skimming documentation quickly.

Decoding Doesn't Guess โ€” It Asks the Browser

A hand-written lookup table, however large, only ever covers the entities someone remembered to include. Decoding here takes a different approach entirely: the encoded text is assigned to a detached <textarea> element's innerHTML, and the browser's own HTML parser โ€” the same one rendering every page you visit โ€” resolves whatever entities are present, correctly, because that's literally its job. That covers all 2,000-plus named character references HTML5 defines, every decimal numeric form, every hex numeric form, with no maintenance required to stay accurate as the spec evolves. The element is never attached to the visible page, so nothing renders and nothing executes โ€” only the resolved text comes back out.

That reliability matters most when the input didn't come from this tool in the first place. A CMS export, a scraped page, or a document pasted from an unfamiliar source can contain any mix of named and numeric entities, sometimes both in the same string, sometimes using an obscure named entity most people have never encountered. A curated table has no way to handle that gracefully; asking the actual parser to do it does, every time.

728 ร— 90 โ€” Leaderboard Ad

Encoding Is a Smaller, More Deliberate List

Going the other direction is a different problem. Named-entity encoding only makes sense for entities a person would actually recognize โ€” &copy; is worth using instead of &#169;, but there's little value in maintaining named forms for characters nobody has memorized anyway. This tool encodes against a curated set of roughly 80 well-known entities โ€” currency symbols, typographic punctuation, common accented Latin letters, a handful of math and arrow symbols โ€” every one of which was individually verified to decode back to the exact original character through the same browser parser described above. Anything outside that set still encodes correctly; it just falls back to a numeric entity, which is exactly as valid and decodes exactly as reliably as a named one.

If it matters exactly which characters ended up encoded and which didn't โ€” checking a template change didn't accidentally alter escaping behavior, say โ€” encode both versions and compare them in the Text Diff Checker rather than eyeballing two long strings of entities side by side.

What This Actually Protects Against

HTML entity encoding is a genuine, necessary defense against cross-site scripting โ€” but only for one specific job: neutralizing markup inserted into an HTML text node, so <script> in a comment field displays as text instead of executing. It is not a universal escaping mechanism. Text inserted unquoted into an attribute, into a <script> block, into a URL, or into a CSS value each has its own injection risks and its own correct escaping method โ€” HTML entity encoding doesn't cover any of those. Knowing which context a piece of text is headed into, and escaping for that specific context rather than assuming one method covers everything, is the actual skill; this tool handles the text-node case correctly and completely, which is real and important, without pretending to be the whole answer.

A Comment Field Is the Everyday Case

User-submitted text โ€” a comment, a review, a bio field โ€” is the most common place this actually matters: someone types an ampersand, a quote mark, or literal angle brackets while describing an HTML tag, and without encoding, that input either breaks the page's layout or, worse, gets interpreted as real markup. The fix is the same one this tool applies by default โ€” encode before display, decode only when you specifically need the raw text back, such as pre-filling an edit form with content that was previously encoded for display. Multi-line submissions add one more wrinkle: a raw newline has no visual effect in rendered HTML, which is exactly the gap Convert Line Breaks to <br> closes, turning a paragraph break the user typed into one the browser actually shows. If the source content mixes in raw HTML that needs cleaning up structurally rather than escaping โ€” closing an accidentally-left-open tag, fixing indentation โ€” that's a job for the HTML Beautifier instead, applied before or after entity encoding depending on which the input actually needs. And if the same value is ever going to travel through a URL as well as display on a page, the URL Encoder & Decoder handles that separate, unrelated layer of escaping โ€” the two are not interchangeable, and applying the wrong one in the wrong place is a fast way to end up with doubly-broken output that neither tool alone can fix.

Verified by ToollyX Team ยท Last updated July 2026

Frequently Asked Questions

728 ร— 90 โ€” Leaderboard Ad

Related Tools