Skip to content
Browser tool Runs locally

HTML Entity Encoder & Decoder

Encode text to HTML character references or decode entities safely in your browser.

Text to encode
Encoded output
Output will appear here.

Encode or decode

Encode converts the five core HTML-sensitive characters to named references. Decode resolves named and numeric character references using the browser's HTML character-reference parser while keeping the result as text.

Common references

  • & becomes &.
  • < becomes &lt;.
  • > becomes &gt;.
  • " becomes &quot;.
  • ' becomes &apos;.

Named and numeric decoding

HTML defines a large set of named character references as well as decimal and hexadecimal numeric references. Decode uses the browser's HTML parser behavior for named references and numeric references instead of executing the resulting text.

Frequently asked questions

Why encode HTML entities?
Character references let text containing characters such as <, >, &, and quotes be represented safely inside HTML text or attributes without being interpreted as markup.
What is the difference between &amp; and &#38;?
&amp; is a named character reference for &, while &#38; is a decimal numeric character reference for the same code point. Hexadecimal references such as &#x26; are another numeric form.
Can decoding entities execute HTML?
No. This tool returns decoded content as text inside the output area. It does not inject the result as HTML and does not execute tags, scripts, or event handlers.
What happens to Unicode characters?
Unicode text is preserved. Numeric character references can represent Unicode code points, including hexadecimal forms.

Related tools