How to use this tool
- Paste the original or entity-encoded text.
- Choose encode/decode and optionally numeric encoding.
- Process one layer and copy the result into the intended context.
How the operation works
A bundled HTML entity table handles named and numeric references. Encoding protects markup-significant characters; numeric mode represents special characters by code point. Decoding follows HTML entity rules, which can leave unknown references unchanged. The output is assigned as plain text, never inserted as executable HTML.
What an HTML entity represents
HTML character references let markup represent characters that might otherwise be interpreted as syntax or be inconvenient to type. The named reference & represents an ampersand. Numeric references identify a code point using decimal or hexadecimal notation. They are different spellings for characters, not encryption.
The encoder uses the entities library for named output. Numeric mode escapes markup-sensitive characters and characters outside printable ASCII as decimal references. The decoder understands HTML named and numeric references. It processes one layer, and the output stays plain text in the result panel.
Encoding and decoding examples
Encode: <p>Tea & coffee</p> Result: <p>Tea & coffee</p> Decode: é or é Result: é
An ampersand reference inside an already encoded string needs another explicit pass to become its final character. For example, decoding &lt; once produces <, not an active less-than tag boundary. Inspect each layer instead of repeatedly decoding until the result “looks right.”
The HTML decoder follows HTML character-reference rules, including legacy references and numeric-reference replacement rules. It is not a strict XML entity validator. Unknown names can remain unchanged, so an unchanged result does not necessarily mean the input was malformed.
Encoding is not HTML sanitization
Entity encoding helps represent literal text in some markup contexts, but safe insertion depends on the exact destination. HTML text, attributes, URLs, CSS and JavaScript have different rules. This tool does not decide which context you will use and does not remove dangerous elements from an HTML document.
Decoded output could contain script tags, event handlers or unsafe URLs. It is never rendered here, but inserting it as active HTML in another application can be unsafe. For Markdown conversion, Markdown to HTML applies its own explicit raw-HTML and destination policy. Do not confuse those rules with entity decoding.
Choose the correct representation
Use URL Encoder / Decoder for percent escapes such as %20, Base64 for byte encoding, and Unicode Converter for four-digit escapes or U+ code points. A string can contain multiple layers, but each layer should have an identifiable source.
The current interface accepts up to 1 MiB of pasted text and rejects empty input. It does not load a webpage, inspect a DOM, fetch external entities or validate a complete HTML document. Copy or download the plain-text result and review it in the intended editor before using it.
A worked example
Tea & coffee
Encoding produces Tea & coffee. Decoding reverses one entity layer.
Escaping for a text node is not a general sanitizer for HTML, JavaScript, URLs or attributes. Use context-appropriate handling in the application that receives the result.
Encoding is not sanitization
Entity encoding represents markup-significant characters so a browser displays them as text. It is the right operation for a text node, an attribute value or a code sample. It is not a general sanitizer: decoding or encoding does not remove scripts, event handlers or dangerous URL schemes, and correct handling depends on where the value will be inserted.
The decoder follows HTML entity rules for named, decimal and hexadecimal references. Unknown names are left unchanged rather than guessed. Decoded output is displayed as inert text and is never inserted as executable markup.
Entity layers and legacy names
Double-encoded text such as &lt; decodes to <, not to <. One pass removes one layer. If a value still shows an entity after decoding, it was encoded more than once or the source intended the entity to remain visible. Numeric mode can encode special characters by code point when named entities are unsuitable.
Legacy names without a trailing semicolon are accepted where HTML permits them, but writing the semicolon is safer. Use URL Encoder / Decoder for URL components and Markdown to HTML when the source is Markdown rather than HTML.
Processing and privacy
HTML Entity Encoder / Decoder transforms the pasted text locally; the markup is not uploaded or rendered as active HTML. Input stays in browser memory until you reset or leave the page. Copy and download run only when you choose them. No tool input is sent to a processing service. Website pages and scripts still make ordinary hosting requests; the privacy policy separates those from tool processing.
Frequently asked questions
Does decoding remove dangerous code?
No. It only changes representation. The tool displays decoded markup as inert text; another application must handle it safely.
Named or numeric references?
Both are understood. Numeric mode can target specific code points when you need them.
Is one decoding pass enough?
Usually—unless the source contains double-encoded text. Inspect the result before decoding again.
Can I use this as a sanitizer?
No. Context-appropriate escaping/sanitizing belongs in the application that receives the text.
Why is an entity still visible after one decode?
It was probably double-encoded. One pass removes one layer, so inspect the source before decoding again.
How this tool was checked
HTML Entity Encoder / Decoder was checked with named references, decimal and hexadecimal references, legacy names, unknown names, one-layer decoding and markup-significant characters. See the testing method or report a failure.