Skip to content

HTML Entity Encoder & Decoder

Encode HTML-sensitive characters or decode named and numeric character references locally as plain text.

Special mode encodes &, <, >, double quote, and apostrophe. Unicode mode also creates hexadecimal numeric references for non-ASCII characters.

0 input characters

Encoded output

0 output characters

Decoded output is shown only as plain text and is never rendered as HTML. Entity encoding is not sanitization; safe HTML handling still depends on where and how content is inserted. Processing stays in your browser.

Your data is processed locally in your browser whenever supported and is not uploaded to our servers.

How it works

Convert HTML entities in three steps

01

Choose a direction

Turn literal characters into entity references or decode references back into plain text.

02

Choose the encoding scope

Encode only HTML-sensitive characters or also convert non-ASCII Unicode to numeric references.

03

Copy plain output

Review the result as text, copy it, or move it back into the input to reverse the conversion.

Native HTML decoding

Character references without rendering the result.

Encoding protects common HTML-sensitive characters. Decoding uses the browser's HTML parser for named and numeric character references, then reads the result only as plain textarea text.

Five sensitive characters

Encodes ampersand, less-than, greater-than, double quote, and apostrophe.

Optional Unicode references

Represents non-ASCII code points as hexadecimal numeric entities without splitting emoji.

Named and numeric decoding

Decodes standard browser-supported named references plus decimal and hexadecimal numeric references.

Plain-text output

Decoded markup is displayed as text and is never injected into the page as executable HTML.

FAQ

Common questions

Which characters are encoded in special-character mode?

Ampersand becomes &amp;, less-than becomes &lt;, greater-than becomes &gt;, double quote becomes &quot;, and apostrophe becomes &#39;. Other characters remain unchanged.

What does the Unicode mode do?

It also converts each non-ASCII Unicode code point into a hexadecimal numeric character reference. An emoji remains one code point reference instead of being split into UTF-16 surrogate halves.

Which entities can be decoded?

The decoder uses the current browser's HTML parser, covering standard named HTML character references and decimal or hexadecimal numeric references.

Does entity encoding make unsafe HTML safe?

Not by itself. Correct escaping depends on whether data is inserted into HTML text, an attribute, a URL, CSS, JavaScript, or another context. Use a trusted context-aware sanitizer or framework for untrusted HTML.

Can decoded HTML run on this page?

No. The result is assigned to a controlled textarea value and displayed only as plain text, not rendered with innerHTML.

Is my input uploaded?

No. Encoding and decoding happen locally in your browser, and Got A Tool does not receive or store the text.

Keep working