AltUtils

HTML Entities

Encode special characters to HTML entities (named, decimal or hex) and decode entities back to text. Escape HTML safely, entirely offline.

CategoryText Mastery
Sheet07 / 42
ProcessingIn your browser
Format
Encode
59 chars
98 chars · 10 encoded

Common HTML entities

Click any entity or character to copy it.

CharNamedDecimalHexDescription
Ampersand
Less-than sign
Greater-than sign
Double quotation mark
Apostrophe (single quote)
Non-breaking space
En space
Em space
Thin space
Soft hyphen (invisible break hint)
Copyright sign
Registered trademark
Trademark sign
Euro sign
Pound sterling
Yen sign
Cent sign
Section sign
Pilcrow (paragraph sign)
Degree sign
Plus-minus sign
Multiplication sign
Division sign
En dash
Em dash
Horizontal ellipsis
Left single quotation mark
Right single quotation mark / apostrophe
Left double quotation mark
Right double quotation mark
Left-pointing double angle quote
Right-pointing double angle quote
Bullet
Middle dot
Left arrow
Right arrow
Up arrow
Down arrow
Left-right arrow
Not equal to
Less-than or equal to
Greater-than or equal to
Infinity
Square root
Fraction one half
Fraction one quarter
Fraction three quarters
Micro sign
Black heart suit
Check mark

What is the HTML Entity Encoder & Decoder?

HTML entities (character references) let you write characters that would otherwise be interpreted as markup or that are hard to type. A named reference like &lt; or &copy; uses a memorable name, while numeric references such as &#169; (decimal) or &#xA9; (hexadecimal) can express any Unicode code point. Escaping the five HTML-special characters — & < > " and ' — is the minimum needed to display user text safely inside HTML and attribute values.

This encoder works on whole Unicode code points rather than UTF-16 units, so emoji and other characters outside the Basic Multilingual Plane become a single correct reference (😀 → &#x1F600;) instead of two broken surrogate halves. Choose whether to escape only the HTML-special characters, also every non-ASCII character (useful for legacy pipelines or ASCII-only email templates), or every character. Named mode uses a name only where HTML5 defines one that decodes back to the exact same character, and falls back to a numeric reference otherwise.

The decoder recognizes all 2,231 named references from the HTML5 specification as well as decimal and hex references, and follows the browser's real parsing rules — including legacy names without a semicolon (&copy2024 → ©2024) and the Windows-1252 remapping of &#128;–&#159;. Decoding uses an inert, detached document, so pasted markup is never rendered and scripts never run. Unknown names such as a mistyped &nbps; are listed so you can spot typos.

Frequently asked questions

Which characters must be escaped in HTML?
In text content, & and < must be escaped (> is recommended). Inside attribute values you also need to escape the quote character that delimits the value, so escaping all five — & < > " ' — is the safe default this tool uses.
Named, decimal or hex — which should I use?
All three are equivalent to browsers. Named references (&eacute;) are easiest to read, decimal (&#233;) and hex (&#xE9;) work for every Unicode character, including ones without a name such as most emoji. Hex matches the U+ notation used in Unicode charts.
Why does my text turn into &amp;amp;?
That is double-encoding: text that was already escaped went through the encoder a second time, so the & that starts each entity was escaped too and &amp; turned into &amp;amp;. Enable “Don't double-encode existing entities” to leave existing references untouched, or decode the text first.
Is &apos; valid HTML?
Yes. &apos; is part of HTML5 and XML. It was not defined in HTML 4, so if you target very old HTML 4 parsers use the numeric form &#39; (choose Decimal) instead.
Does HTML escaping protect against XSS?
Escaping & < > " ' prevents injected text from creating tags or breaking out of quoted attributes, which covers HTML body and attribute contexts. It is not sufficient inside JavaScript (script blocks, inline event handlers), CSS or URLs (for example javascript: links); those contexts need their own encoding or validation.
Is my text sent to a server?
No. Encoding and decoding happen entirely in your browser with JavaScript, so you can safely process private templates or content even when offline.