🛠️ Developer & Web

HTML Entity Encoder / Decoder

Escape text for HTML — or decode entities back to text.

  • Freeno limits, no watermark
  • 0sign-ups or accounts
  • Privateruns on your device
  • Any devicephone, tablet or PC

Why escape HTML?

Five characters have special meaning in HTML: < and > start and end tags, & starts an entity, and " and ' delimit attribute values. To show them as text — for example code samples in a blog post — they must be written as entities: &lt;, &gt;, &amp;, &quot; and &#39;. Escaping user input before inserting it into a page is also the core defence against cross-site scripting (XSS).

Encoding non-ASCII characters

With UTF-8 pages (the standard today) characters like é, ₹ or emoji can be written directly. Encoding them as numeric entities is only needed for systems that can’t handle UTF-8, such as some old email clients or databases. Decoding turns every named (&nbsp;, &copy;), decimal and hex entity back into its character — handy for cleaning text scraped from web pages or APIs.

Everything runs in your browser — your code and data are never uploaded, so it is safe to paste private config files and API responses.

Frequently asked questions

What is &amp;nbsp;?

A non-breaking space — a space that won’t wrap to a new line.

Is escaping enough to prevent XSS?

It is essential for text in HTML content; attributes, URLs and scripts need context-specific encoding too.

Named or numeric entities?

Both work everywhere; named ones are more readable, numeric ones cover every Unicode character.

Found it useful? Share the HTML Entity Encoder:

Last updated 2026-11-21 · Built by Vinayak Agarwal · Part of Developer & Web (77 tools)