HTML Entity Encoder / Decoder
Convert between text and HTML entities instantly.
Common HTML Entities
HTML Entity Reference
| Character | Named Entity | Decimal | Hexadecimal | Description |
|---|
What This HTML Entity Encoder Does
This HTML entity encoder converts text into a form you can paste inside HTML without the browser treating it as markup, and its Decode tab turns entity-encoded text back into readable characters. Use it to show a code snippet on a web page, put quoted text into an attribute, or clean up text that arrived full of codes like " and ’.
How to Use It
- On the Encode tab, type or paste into Text to Encode. The Encoded Result box updates as you type.
- Choose an Entity Format: named, decimal, or hexadecimal. This controls how characters outside plain ASCII, such as é, © or an em dash, are written.
- Tick Encode all characters (not just special ones) if you want every character, including letters, digits, spaces and line breaks, turned into an entity. An ordinary space becomes   (  in hex); only a real non-breaking space becomes .
- Click Copy Encoded. The counters under the result show how many characters you entered and how many entities the output contains.
- To reverse the process, switch to the Decode tab, paste into HTML Entities to Decode, and click Copy Decoded.
Below the tool, the HTML Entity Reference table lists the characters the encoder knows by name. Type in its search box to filter it, and click any row to copy that character's named entity.
Which Characters Must Be Encoded
Only five characters are dangerous in HTML, because the parser reads them as part of the markup. The encoder always converts these five, in every format, and always uses their named form:
| Character | Entity | Why it needs encoding |
|---|---|---|
| < | < | Starts a tag |
| > | > | Closes a tag |
| & | & | Starts an entity |
| " | " | Ends a double-quoted attribute |
| ' | ' | Ends a single-quoted attribute |
Everything else is about representation, not safety. By default, ASCII letters, digits, spaces and punctuation pass through unchanged, and any character above code 127 is converted using the format you picked.
For example, this input:
<a href="?q=tea&lang=en">Café © 2026</a> becomes this with Named entities selected:
<a href="?q=tea&lang=en">Café © 2026</a> With Decimal, the © becomes ©; with Hexadecimal, é becomes é and © becomes ©. Notice that é came out as é even in named mode. The encoder only uses names for the 26 characters in the reference table (such as ©, €, → and …) and falls back to a decimal code for everything else. Both forms display the same character.
Emoji and other characters above U+FFFF are encoded as a single reference to their full code point, so 😀 becomes 😀 in decimal or 😀 in hex, never a pair of surrogate halves that browsers would show as two broken symbols.
Named, Decimal and Hex Entities Compared
All three forms point to the same Unicode code point, so ©, © and © all render as ©.
- Named entities are the easiest to read in source code, but only names defined in the HTML specification work. XML, RSS feeds and standalone SVG files understand just five names (&, <, >, " and '), so © in an XML feed causes a parse error.
- Decimal entities (©) work in HTML and XML alike, which makes them the safest choice when you are unsure where the text will end up.
- Hexadecimal entities (©) match the U+00A9 notation used in Unicode charts. The encoder writes hex digits in lowercase.
What the Decoder Converts
The Decode tab turns every decimal reference (&) and hex reference (& or &) back into its character, including emoji such as 😀. Named entities are looked up by your browser's own HTML parser, so every name in the HTML standard works, from & and to é, — and ½. As in browsers, numbers 128 to 159 are read as Windows-1252 characters, so – becomes an en dash.
An entity is only decoded when it ends with a semicolon. Anything the decoder cannot resolve, such as a misspelled name or a number that is not a valid Unicode code point (�, a surrogate like �, or anything above ), is left exactly as written. Decoding runs a single pass, so double-encoded text like &lt; becomes <. Paste the result back in to decode it a second time.
Tips and Gotchas
- You rarely need to encode accented letters. A UTF-8 page with
<meta charset="utf-8">can contain é, € and curly quotes directly. Encode them only when an editor, database or email system garbles non-ASCII text. - URLs need a different encoding. Inside a link's
href, an ampersand should be written as &, but spaces and other reserved characters in the query string need percent-encoding. Use the URL encoder and decoder for that part. - ' is HTML5 and XML only. It was not defined in HTML 4, and some older email clients ignore it. The encoder always outputs ' for an apostrophe, so replace it with ' if you target such clients.
- Entities are not Base64. Entity encoding keeps text readable in HTML. If you need to embed binary data or move it through a text-only channel, use the Base64 encoder instead.
- Writing in Markdown? The Markdown to HTML converter escapes <, > and & inside code spans and code blocks for you.
Frequently Asked Questions
What is the difference between named and numeric entities?
Named entities use a readable name (©), while numeric entities use the character's code point in decimal (©) or hexadecimal (©). All three render the same character in HTML. Numeric entities also work in XML, where most names are not defined.
Do I need to encode every special character in HTML?
No. You must encode < and & in text, and the quote character that wraps an attribute value. In a UTF-8 page, accented letters and symbols can be typed directly. This tool's default mode also encodes anything above ASCII, which is the safe choice when you do not control the page encoding.
Why does my page show & or " as text?
The text was encoded twice, usually by a CMS or template that escapes content that was already escaped. Paste it into the Decode tab and run it through twice: the first pass turns &amp; into &, and the second turns that into &.
What does do?
is a non-breaking space. It looks like a space but stops the browser from wrapping a line at that point, so writing 10 km keeps the number and unit together. Several in a row also stop the browser from collapsing repeated spaces.
Is HTML entity encoding enough to prevent XSS?
Only for text placed in element content or quoted attribute values. Content inserted into a <script> block, an event handler, CSS or a URL needs context-specific escaping, and a javascript: link is still dangerous after entity encoding, so check user-supplied links against allowed schemes such as https.
Why does the decoder understand é but the encoder never writes it?
The decoder accepts every named entity in the HTML standard, because it asks your browser to resolve each name. The encoder deliberately writes names only for the 26 characters in the reference table and uses a numeric reference for everything else, such as é for é or — for an em dash. Numeric references render the same character and also work in XML.
Is my text uploaded anywhere?
No. Encoding and decoding are done by JavaScript running in your browser tab, and the text you enter is not sent to a server.
Love using BreezyTools?
Go Pro for an ad-free experience, priority features, and support independent development — for less than a coffee a month.