📄 HTML Entity Encoder & Decoder

Convert special characters to HTML entities and back. Supports named, decimal, and hex entity formats.

Last updated: November 8, 2026 · By the BoltQuickTools team

Show code as text, or read text full of ampersand codes

If you paste <div> into a web page, the browser treats it as a tag. To show it as text, the angle brackets need to be written as entities. The reverse problem is common too: feed output or scraped HTML full of &amp; and &#39; that you just want to read. This page converts in both directions, inside the page.

Converting

  1. Choose Encode or Decode. Changing the tab does not rerun the conversion, so press Convert or edit the text afterwards.
  2. When encoding, pick Named, Decimal or Hex, and tick Encode all characters if you want literally everything converted.
  3. Type in Input and the Output box follows. Copy Output copies it and Clear resets the page.

One sentence, three formats

The input is 5 < 7 & "ok" © it's €5 é.

FormatOutput
Named5 &lt; 7 &amp; &quot;ok&quot; &copy; it&apos;s &euro;5 é
Decimal5 &#60; 7 &#38; &#34;ok&#34; &#169; it&#39;s &#8364;5 é
Hex5 &#x3C; 7 &#x26; &#x22;ok&#x22; &#xA9; it&#x27;s &#x20AC;5 é

With Encode all characters and Named selected, Hi é becomes &#72;&#105;&#32;&#233;. Characters with no entry in the page's named list fall back to decimal, including spaces and line breaks.

Behaviour to expect

Choosing and trusting an encoding

Which format should I choose?

Named is easiest to read in source. Decimal and hex work for any character. Note that &apos; is part of HTML5 but was not in HTML 4, so choose a numeric format if very old software will read the output.

Is encoding enough to stop script injection?

For text placed between tags or inside a quoted attribute, these five characters are the right ones to encode. It does not make a value safe inside a URL, a script block or CSS, which each have their own rules. See the web security basics article.

How is this different from URL encoding?

They solve different problems. %3C is for URLs and &lt; is for HTML. For the former use the URL encoder. To see code points or JavaScript escapes for a character, use the Unicode converter.