Global ToolBox

HTML Entity Encoder/Decoder

Convert text to and from HTML entities like &, <, and é instantly, right in your browser — nothing ever leaves your device.

🔒 Processed locally in your browser

Loading…

How to use

  1. Choose Encode or Decode using the mode toggle above.
  2. In Encode mode, type or paste any text into the input box.
  3. In Decode mode, paste text containing HTML entities instead.
  4. The result updates instantly below — use Copy to copy it, or Reset to clear.

Features

  • Escapes the 5 XML-safe characters (& < > " ') needed to safely embed text as HTML
  • Also encodes common accented letters as named entities, like é → &eacute;
  • Decodes named entities, decimal entities (&#233;), and hex entities (&#xE9;)
  • Updates live as you type — no button to press
  • 100% client-side — your text never leaves your browser

Frequently asked questions

Why do I need to encode characters like < and & for HTML?

Browsers treat < and & as the start of markup. If you insert text containing a raw < into an HTML page without encoding it, the browser may try to interpret it as the start of a tag instead of displaying it literally, which can break the page or, in the worst case, allow HTML injection. Encoding it as &lt; guarantees it always displays as the character < .

Is this tool a general-purpose HTML sanitizer?

No. This tool encodes plain text so it displays safely as HTML text content — it doesn't parse, clean, or validate existing HTML markup. If you need to sanitize untrusted HTML (e.g. removing scripts from user-submitted HTML), you need a dedicated HTML sanitizer library, not this tool.

What's the difference between &#39; and &apos;?

Both represent an apostrophe ('). &#39; is the numeric form and is safe in all HTML versions; &apos; is a named entity that wasn't officially part of HTML until HTML5. This tool encodes apostrophes as &#39; for maximum compatibility, but decodes both forms.

What's the difference between a named entity and a numeric entity?

A named entity like &eacute; uses a memorable name for a specific character. A numeric entity like &#233; or &#xE9; specifies the character's Unicode code point directly, in decimal or hexadecimal. Numeric entities can represent any character in Unicode; named entities only exist for a defined set of common ones.

Does this tool store or upload my data?

No. All encoding and decoding happens locally in your browser using JavaScript. Nothing is sent to a server or stored anywhere.

Related tools