HTML Encode and Decode

HTML Encode and Decode

Escape text so it displays safely inside HTML, or turn HTML entities back into plain text.

The HTML Encode and Decode tool converts between raw characters and HTML entities, the escape codes that let a browser display characters instead of interpreting them as markup. Type a real less-than sign into a page and the browser tries to read a tag; write it as an entity and it shows as text. Anyone who writes tutorials, shows code samples, or handles user-generated content needs this conversion constantly.

Encoding escapes the five characters that matter most: the ampersand, angle brackets, and both quote styles, so your text can sit safely inside HTML or inside an attribute value. An optional setting also converts non-ASCII characters into numeric entities, which is handy for legacy pages with limited charset support. Decoding runs the process in reverse using the browser's own entity engine, so named, numeric, and hex entities all resolve correctly.

Both directions run locally in your browser with nothing uploaded, making the tool safe for snippets from private projects.

How to use

  1. Paste the text or the entity-encoded string into the box.
  2. Tick the numeric option if you need non-ASCII characters encoded too.
  3. Click Encode or Decode.
  4. Copy the result from the lower box.

Frequently asked questions

Why encode the ampersand first?

Because every entity starts with an ampersand. Encoding it first prevents the entities created for other characters from being double-encoded, which is the most common bug in hand-written escapers.

When do I need the numeric entity option?

Only for older pages or strict pipelines that cannot rely on UTF-8. Modern pages with a UTF-8 charset can show non-English characters directly without entities.

Does decoding handle named entities like copy?

Yes. Decoding uses the browser's built-in HTML parser, so the full standard entity set works, not just the five basic ones.

Is my text sent anywhere?

No. Everything happens in your browser.