All tools

HTML Entity Encoder / Decoder

Escape and unescape HTML special characters safely.

Input
Output

Encode & Decode HTML Entities

When you display user-supplied text on a web page, characters like <, >, and & must be escaped into HTML entities — otherwise they break your markup or open the door to cross-site scripting (XSS). This tool escapes those characters and decodes entities back to plain text.

Characters escaped

  • & becomes &amp;
  • < becomes &lt;
  • > becomes &gt;
  • " becomes &quot;
  • ' becomes &#39;

Decoding too

Switch to Decode to turn any named or numeric HTML entity — including &copy;, &#169;, and &amp; — back into its original character using the browser's own decoder.

Security and correctness

Escaping output is the single most important defence against stored and reflected XSS. Whenever you inject dynamic content into HTML, encode it first so the browser renders it as text rather than executing it as markup or script.

100% Private & Processed Locally

Every conversion on this page runs entirely inside your browser using JavaScript. Your data is never uploaded to a server, logged, or stored — making this tool safe even for sensitive payloads such as API responses, configuration files, and access tokens.

Because there is no network round-trip, conversions are instant and work even when you are offline. It is free to use with no sign-up, no rate limits, and no ads injected into your output.

Frequently Asked Questions

Common questions about the HTML Entity Encoder & Decoder.

What characters get escaped?
The reserved HTML characters & < > " and ' are converted into their entity equivalents such as &amp; and &lt;.
Why is escaping important?
Escaping user-supplied text before inserting it into HTML is the primary defence against cross-site scripting (XSS) attacks.
Can it decode entities too?
Yes. The Decode action turns named and numeric HTML entities back into their original characters.

More Developer Utilities

View all tools →
JSON ValidatorJSON MinifierJSON to CSVCSV to JSONJSON to XMLXML to JSONJSON to YAMLYAML to JSON
File Transfer