Text & Data

HTML Entity Encoder & Decoder

Safely encode and decode HTML named entities and numeric character references in your browser.

Runs locally in your browser

The result is handled as text; it is never executed or parsed as HTML.

Quick examples
Enter a value to get started.

How to use this HTML entity converter

Choose encode or decode, then choose named, decimal, or hexadecimal output and whether all non-ASCII characters should be encoded. Decoding strictly recognizes named and numeric entities that end with semicolons; all calculations happen in your browser.

Named and numeric entities

The tool includes common Latin accent, currency, math, and arrow names such as &amp;Aacute;, &amp;NotEqual;, and &amp;rarr;, but it is not a complete HTML5 named-entity table. Chinese characters and emoji without a named mapping safely fall back to decimal references. Hexadecimal references start with <code>&amp;#x</code>, and all three formats can be decoded.

Strict validation and safe handling

Missing semicolons, unknown names, invalid digits, out-of-range values, and surrogate code points are reported as errors. Decoded text is placed only in a read-only textarea, never inserted with innerHTML, so content such as <code>&amp;lt;script&amp;gt;</code> cannot execute.

Frequently asked questions

Why are semicolons required?

Strict mode requires every entity to end explicitly with a semicolon. This avoids mixing no-semicolon references with ordinary text and surfaces malformed pasted input.

Are Chinese characters and emoji handled correctly?

Yes. The converter works with Unicode code points, so astral characters such as emoji are not split into surrogate halves; all-non-ASCII mode emits their numeric references.

Will decoded tags execute?

No. Decoding only creates a string and displays it in a read-only textarea. It is never parsed or inserted into the DOM as HTML.

Does this cover the complete HTML5 named-entity table?

No. The tool covers common named entities. For a valid HTML5 name outside the built-in table, use its decimal or hexadecimal numeric reference, or confirm the name in the browser standard entity table.