Skip to content

HTML Entity Encoder / Decoder

Encode text to HTML entities or decode entities back to text.

Processed locally — your text is never uploaded.

Mode

How do you encode and decode HTML entities?

Encoding replaces the reserved characters &, less-than, greater-than, double quote and apostrophe with their entity equivalents; decoding resolves named entities such as © and numeric ones such as © or ©. Entities let you show characters that would otherwise be read as markup. Encoding a bold tag around “Tom & Jerry” turns the brackets and ampersand into <, > and &.

Understanding your result

Entities let you show characters that would otherwise be interpreted as markup, and protect against broken layouts when displaying user content.

Formula and method

Encoding replaces the reserved characters &, less-than, greater-than, double quote and apostrophe with their entity equivalents. Decoding resolves named entities such as © and numeric entities such as © or ©.

Worked example

Encoding a bold tag around “Tom & Jerry” turns the angle brackets and ampersand into <, > and &.

How to use this tool

  1. Choose Encode or Decode.
  2. Paste your text or HTML.
  3. Copy the converted output.

Common mistakes to avoid

  • Encoding text twice, which turns & into a double-escaped entity.

About the HTML Entity Encoder / Decoder

Convert reserved and special characters to HTML entities so they display correctly, or decode entities back to plain text. Everything runs in your browser.

Explore all Developer Tools tools

Frequently asked questions

Does this prevent XSS?

Encoding output before inserting it into HTML is one important defence, but always escape on the server too and use a strict templating layer.

Are numeric entities supported?

Yes. Decoding handles decimal and hexadecimal numeric entities as well as common named entities.

Share this tool

Free to use — copy the link, share it anywhere, or add the tool to your own website.

Embed this tool on your site (free)

Copy this code and paste it into any web page — it stays free and always up to date: