HTML5 · XML 1.0 · named & numeric entities

HTML entities encoder

Escapes characters that would be parsed as markup: &, <, >, ", ', and optional full entity encoding for all characters via numeric references.

0 chars
encodes to
or decode
0 chars

How to use this tool

  1. Type or paste text into the Text → HTML entities box — the encoded output appears instantly in Entity-encoded.
  2. Choose a mode with the radio buttons: HTML5 mode (default) or XML mode (bare minimum).
  3. Check Named entities only to escape just the special characters and leave everything else untouched, or leave it unchecked to also convert every other character to a numeric reference.
  4. Hit Copy result to copy the encoded string to your clipboard.
  5. To decode, paste an entity-encoded string into HTML entities → Text and read the plain text in Decoded text.
  6. Use Clear any time to reset a box and start over.

Why this tool is helpful

Escape untrusted text

Turning &, <, >, ", and ' into entities keeps user input from being parsed as tags or attributes.

Show code on a page

To display a snippet like <div> in HTML you must escape the angle brackets — this tool produces exactly that.

Decode mangled markup

Paste double-escaped text such as &amp;lt; and recover the original < character.

Full numeric encoding

Leave Named entities only unchecked and every character becomes a decimal reference like &#65;, so nothing is ever interpreted as markup.

Decode any named entity

Beyond the core five, the decoder resolves names like &nbsp; and &copy; through the browser's own HTML parser.

Stay private

Everything runs in your browser. Nothing is uploaded, logged, or sent to a server.

FAQ

What does this tool do?

It encodes text into HTML/XML entities and decodes them back. Encoding replaces special characters with named entities such as &amp; and &lt;, or numeric references like &#65;; decoding reverses that.

Which characters are escaped?

The five markup-significant characters: &&amp;, <&lt;, >&gt;, "&quot;, and '&apos;.

What does the "Named entities only" checkbox change?

Unchecked (the default), every other character also becomes a decimal reference such as &#65;, so even ordinary letters are encoded. Checked, only the five special characters are escaped and everything else passes through unchanged.

What's the difference between HTML5 mode and XML mode?

Both modes escape the same five characters to named entities in this tool. The XML mode is labeled bare minimum because XML only strictly requires &amp; and &lt; to be escaped, but the tool applies the full five-character set in either mode.

Does it emit decimal or hexadecimal references?

Encoding emits decimal references, such as &#65; for the letter A. The decoder accepts both decimal (&#65;) and hexadecimal (&#x41;) forms.

Can it decode emoji, other scripts, and named entities?

Yes. Numeric references like &#128512; and &#x1F600; decode to their Unicode code point, and named entities beyond the core five — such as &nbsp; and &copy; — are resolved with the browser's own HTML parser.

Does any of my data leave my browser?

No. All encoding and decoding runs locally in JavaScript. Your input is never sent to, stored on, or logged by a server.