Encode / Decode

HTML Entity Encode / Decode

Escape special characters into HTML entities, or decode entities back to plain text. Uses the he library for accurate entity handling — it knows all 2,000+ named HTML entities, not just the common ones like & and <. You can choose named references (&) or numeric ones (& or &), and optionally encode every character.

HTML Entity Encode/Decode — Escape and unescape HTML entities

What it does

  • Encodes <, >, &, ", ' and any other characters into HTML entities
  • Decodes all named HTML entities (not just the common five)
  • Choice of named entities (&amp;) or numeric (&#38; / &#x26;)
  • Optional full encoding mode that encodes every character as an entity
  • Toggle between decimal and hex numeric references
  • Auto mode detects whether input is encoded and picks the right direction

Use cases

  • Escaping user-generated content before displaying it in HTML
  • Decoding entity-encoded text from a CMS or RSS feed
  • Preparing text for use inside an HTML attribute value
  • Debugging double-encoding issues where entities got encoded twice

How it works

1

Paste your text into the input pane

2

Choose Encode, Decode, or Auto mode

3

Toggle named vs numeric references and other options as needed

4

The result appears instantly in the output pane

Frequently asked questions

1What's the difference between named and numeric entities?

Named entities use readable names like &amp; for & and &copy; for ©. Numeric entities use the character's code point: &#38; (decimal) or &#x26; (hex) for &. Named entities are more readable; numeric ones work for any character.

2When would I use 'Encode all characters'?

This encodes every character as a numeric entity, not just special characters. It's useful for obfuscating text (like email addresses to hide them from spambots) or when you need to ensure no character is interpreted as HTML.

3Does it handle all HTML5 named entities?

Yes. The tool uses the he library which supports all 2,000+ named entities defined in the HTML5 spec, including entities like &mdash;, &hellip;, &trade;, and all the mathematical and symbol entities.

Related tools

Use HTML Entity Encode/Decode offline in Devinity

All 95 tools run locally on your Mac. No internet required, no data sent to servers.

Download Devinity →