JSON Parser

HTML Entity Encoder & Decoder

Escape special characters as HTML entities so they display as text, or decode entities like & and © back into readable characters. Encoding and decoding run in your browser.

How to encode or decode HTML entities

  1. Choose Encode to escape text, or Decode to convert entities back.
  2. Paste your text or HTML into the left panel. The result appears on the right.
  3. When encoding, tick Also encode non-ASCII to turn every non-ASCII character (accents, symbols, emoji) into a numeric entity as well.

Characters the encoder escapes

CharacterEntityWhy
&&Starts every entity, so it must be escaped first
<&lt;Would open an HTML tag
>&gt;Would close an HTML tag
"&quot;Would end a double-quoted attribute
'&#39;Would end a single-quoted attribute

With Also encode non-ASCII on, other characters become decimal numeric entities, for example é becomes &#233;, € becomes &#8364; and © becomes &#169;.

Named vs numeric entities

A named entity uses a keyword (&copy;) while a numeric one uses the character's code point in decimal (&#169;) or hex (&#xA9;). They render identically. The decoder understands all three forms, plus other named entities such as &nbsp;, &mdash; and &euro;, because it uses the browser's own HTML parser and nothing in your input is executed.

When to use it

  • Showing code samples or user-submitted text inside an HTML page.
  • Putting values into HTML attributes safely.
  • Cleaning text copied from web pages that contains &amp; and &nbsp;.
  • Making sure special characters survive systems that only handle ASCII.

In application code, use your framework's built-in escaping (React, templating engines) rather than hand-escaping, since it applies the right rules for each context. This tool is best for one-off conversions and for checking results.

Related tools

Percent-encode URL parts with URL Encode / Decode, escape JSON strings with JSON Escape, or tidy markup with the HTML formatter.

Frequently asked questions

Why encode HTML entities?
Characters like < and & are part of HTML syntax. Encoding them as &lt; and &amp; makes sure they display as text instead of being interpreted as markup, which also helps prevent injection bugs.
What is the difference between named and numeric entities?
Named entities use a keyword (&copy;); numeric entities use the character's code point (&#169; or &#xA9;). Both render the same.
Does it decode all entities?
It uses the browser's own HTML parser, so every standard named and numeric entity is decoded. Everything runs in your browser — nothing you enter is uploaded to a server.
Handles JSON files up to 20MB smoothly