HTML Entity Encoder/Decoder
Encode or decode HTML entities with minimal or all-non-ASCII scope.
Written by Golam Rabbani, Founder & Lead Engineer
How to use this html entity encoder/decoder
- Paste the text you want to encode or decode into the input area.
- Pick Encode to convert characters to HTML entities, or Decode to reverse them.
- When encoding, choose Minimal (only the five reserved characters) or All non-ASCII (encode anything outside printable ASCII too).
- Press the action button to run the conversion.
- Copy the result, or hit Reset to clear the form.
About this html entity encoder/decoder
The HTML entity encoder escapes the characters that have special meaning in HTML so they render as literal text instead of being interpreted as markup. In Minimal mode it encodes the five reserved characters: & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. In All non-ASCII mode it additionally encodes every code point outside printable ASCII (U+0020 to U+007E) using numeric character references, which is the safest way to embed accented characters and emoji in environments that mangle UTF-8.
The decoder reverses both numeric (&#NNN; and &#xHEX;) and named entity forms, including the common set used in CMS exports: &, <, >, ", ', , ©, ®, ™, …, —, –, smart quotes, ·, •, currency symbols, and a handful of typographic favourites. Everything runs in your browser, so confidential strings never leave your machine.
For example, encoding the input <p class="lead">Café & Co.</p> in Minimal mode produces <p class="lead">Café &amp; Co.</p> — safe to drop directly into another HTML page or a database column that already escapes input.
FAQ
- What is the difference between Minimal and All non-ASCII?
- Minimal only encodes the five reserved characters that change HTML meaning. All non-ASCII also encodes everything outside printable ASCII, which is helpful in legacy systems that do not handle UTF-8 cleanly.
- Which named entities does the decoder recognise?
- The 32 most common ones — &, <, >, ", ', , ©, ®, ™, …, —, –, smart quotes, currency, degree, plus/minus, multiplication and division signs, and a few more. Numeric references (&#NNN; and &#xHEX;) cover everything else.
- Why is the single quote encoded as ' instead of '?
- ' is valid in XHTML and HTML5 but not in HTML 4.01, so ' is the universally safe encoding. The decoder still understands ' on the way back.
- Will it break URLs in href and src attributes?
- Encoding only changes how the characters appear in the source — browsers decode them before resolving the URL. Use the URL Encoder tool for percent-encoding if your target is a URL component rather than HTML text.
- Is my text uploaded?
- No. Encoding and decoding run entirely in your browser.
- How is this different from a URL encoder?
- HTML entity encoding protects characters with HTML meaning. URL encoding (percent-encoding) protects characters with URL meaning — different rule sets, different escape syntax, different use cases.