HTML Entity Encode / Decode

Encode text to HTML entities or decode entities back to characters, including numeric ones.

Private & SecureRuns in your browser — nothing is uploaded
Easy to UseJust paste or type — instant results
Free ForeverUnlimited use, no sign-up
Fast & ReliableAdvanced tech, fast and stable

Some characters cannot appear as-is in HTML: a less-than sign (<) starts a tag, an ampersand (&) starts an entity. This converts text to and from HTML entities, so a snippet you want shown literally appears as characters instead of breaking the markup, and an entity-laden string turns back into plain text.

<b>&lt;b&gt;
Encode & decode entities

How to use: HTML Entity Tool

  1. 1Enter inputChoose encode or decode.
  2. 2Set optionsPaste your text or HTML.
  3. 3ProcessOptionally encode all non-ASCII.
  4. 4Get resultCopy the converted result.

Common use cases

Show code on a pageTurn a tag or snippet into entities so the browser prints it instead of rendering it.
Decode scraped textConvert a string full of entities back into the readable characters it stands for.
Clean up stray entitiesFix content where symbols arrived as raw entities instead of the letters they represent.
Prepare safe outputEncode user-supplied text before it goes into a page so stray angle brackets cannot break the layout.

Good to know

Named and numeric formsAn entity can be a name, like the one for the ampersand, or a numeric code point. The tool reads both and can produce either.
Encoding is not sanitisingEntity-encoding makes text display safely, but on its own it is not a complete defence against injection; server-side handling still matters.
Only the risky characters changeLetters and digits are left alone; the tool only touches characters that carry a special meaning in HTML.
It round-trips cleanlyEncode then decode and you get the original text back, so you can move a snippet through HTML and recover it intact.

Frequently Asked Questions