HTML Entity Encoder & Decoder Online

Local only

Encode HTML-sensitive characters or decode common named and numeric character references locally.

30 chars · 1 line

60 chars · 1 line

Escaping HTML-sensitive characters

HTML entity guide

How to encode and decode HTML entities

Escape HTML-sensitive characters before placing literal text into HTML source, or decode common named and numeric character references back into readable text. Processing stays in your browser, so snippets and template content are not uploaded. This tool is free to use. No account or payment is required.

Last updated

What you can do here

  • HTML-sensitive character escaping
  • Common named and typographic reference decoding
  • Decimal numeric reference decoding
  • Hexadecimal numeric reference decoding
  • Invalid reference preservation
  • Browser-local processing

Steps

  1. Paste the text, HTML snippet, or entity-encoded value.
  2. Choose Encode to escape ampersands, angle brackets, quotes, apostrophes, and non-breaking spaces.
  3. Choose Decode to restore common named references and decimal or hexadecimal numeric references.
  4. Review the output, then copy or download it.

Escape text before inserting it into HTML source

Encoding replaces characters that have special meaning in HTML markup. For example, < becomes &lt; and & becomes &amp;, which makes the literal characters visible instead of treating them as markup syntax.

This utility is for text transformation and debugging. Context-aware application escaping still belongs in your framework or templating layer, especially for attributes, URLs, JavaScript, and CSS contexts.

Decode named and numeric character references

Decode restores common markup and typographic named references such as amp, lt, gt, quot, nbsp, copy, trade, and hellip. It also resolves valid decimal references such as &#169; and hexadecimal references such as &#x1F600;.

Unknown named references and invalid Unicode code points are left unchanged so the output does not silently invent a replacement character.

Encode an HTML snippet as literal text

Angle brackets, quotes, and ampersands are escaped while ordinary letters and whitespace remain readable.

Text input

<p title="R&D">Tom & Jerry</p>

Encoded output

&lt;p title=&quot;R&amp;D&quot;&gt;Tom &amp; Jerry&lt;/p&gt;

Common questions

Frequently asked questions

Which characters does Encode escape?

It escapes ampersand, less-than, greater-than, double quote, apostrophe, and non-breaking space. This covers the common HTML-sensitive characters without rewriting ordinary Unicode text.

Does Decode support numeric HTML references?

Yes. Decimal references such as &#169; and hexadecimal references such as &#x1F600; are decoded when they represent a valid Unicode code point.

Is this a substitute for XSS protection?

No. Use the escaping rules provided by your framework for the exact HTML, attribute, URL, JavaScript, or CSS context. This tool helps inspect and transform text; it is not a sanitizer.

Does VetaTool upload the HTML or text?

No. HTML entity encoding and decoding happen locally in your browser.

Looking for broader references? Browse all developer guides.