100% offline
Developer
Free · no signup
Updated

HTML Entity Encoder / Decoder

An HTML Entity Encoder/Decoder converts characters to their HTML entity equivalents — such as ampersand to & and less-than to < — and decodes entities back to plain characters, all in your browser so your text never leaves the page.

About HTML Entity Encoder / Decoder

Encode mode escapes the characters that break HTML — ampersand, angle brackets, and quote characters — and can optionally encode all non-ASCII characters as numeric entities for maximum compatibility. Decode mode turns named and numeric entities back into their characters using the browser's own HTML parser, so it understands the full entity set. Use it to safely display code in a page, debug mojibake, or clean up scraped markup. Nothing is uploaded.

What HTML Entity Encoder / Decoder does

  • Encode the five special HTML characters
  • Optionally encode all non-ASCII as numeric entities
  • Decode named and numeric entities via the native HTML parser
  • Handles the full standard entity set on decode
  • One-click copy of the result
  • Runs entirely in your browser — nothing uploaded

When to reach for HTML Entity Encoder / Decoder

  • Displaying code or markup as text on a web page
  • Escaping content before injecting it into HTML
  • Decoding entities in scraped or exported content
  • Debugging double-encoded strings

How to use HTML Entity Encoder / Decoder

  1. 01

    Choose a mode

    Pick encode or decode.

  2. 02

    Paste your text

    Enter plain text to encode, or entities to decode.

  3. 03

    Copy the result

    Copy the converted output with one click.

When to use HTML Entity Encoder / Decoder vs alternatives

AlternativeUse HTML Entity Encoder / Decoder when…Use the alternative when…
Writing an escape function by handyou want a quick check without wiring up code.you need escaping inside your own template layer.
url-encoderyour target is HTML markup.your target is a URL or query string.

Frequently asked questions

Which characters need HTML-encoding?
The critical ones are the ampersand (&), less-than (<), and greater-than (>), plus the double-quote (") and apostrophe (') inside attribute values. Encoding these stops text from being parsed as markup — the root defense against many HTML injection bugs.
Does decoding handle named entities like the copyright sign?
Yes. Decoding uses the browser's own HTML parser, so it resolves the full set of named entities (©, —,  , and so on) as well as numeric ones like © and ©.
Is this a substitute for escaping in my framework?
For display convenience, yes; for security, rely on your framework's contextual auto-escaping (React, Vue, and others escape by default). This tool is for inspecting and one-off conversions.

Related reading