📄 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 & and ' that you just want to read. This page converts in both directions, inside the page.
Converting
- Choose Encode or Decode. Changing the tab does not rerun the conversion, so press Convert or edit the text afterwards.
- When encoding, pick Named, Decimal or Hex, and tick Encode all characters if you want literally everything converted.
- 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 é.
| Format | Output |
|---|---|
| Named | 5 < 7 & "ok" © it's €5 é |
| Decimal | 5 < 7 & "ok" © it's €5 é |
| Hex | 5 < 7 & "ok" © it's €5 é |
With Encode all characters and Named selected, Hi é becomes Hi é. Characters with no entry in the page's named list fall back to decimal, including spaces and line breaks.
Behaviour to expect
- With the box unticked, the page converts the five HTML-sensitive characters plus 34 common symbols it has names for, such as ©, € and curly quotes. Other characters stay literal, so accented letters and emoji are left alone. The em dash is not on that list either, so it also stays literal.
- Encoding is not idempotent. Encoding text that already has entities turns
<into&lt;. - Decoding happens once.
&lt;decodes to<, so run it again for double-encoded text. - Decoding follows browser rules, including legacy names with no semicolon.
©gives ©, and¬anentity;gives¬anentity;. - Tags pass through Decode unchanged, as plain text. To remove them, use the HTML tag stripper.
- The statistics line counts anything shaped like an entity, so it is a rough figure.
- The Live HTML Preview always shows plain text. Encoded output has no active markup, and Decode writes its result as text, so nothing in the preview can run.
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 ' 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 < is for HTML. For the former use the URL encoder. To see code points or JavaScript escapes for a character, use the Unicode converter.