Certain characters have special meaning in HTML and must be escaped to display literally — < becomes <, & becomes &, and so on. This tool escapes text to HTML entities and decodes entities back to plain characters, entirely in your browser.
How to use it
- Type or paste your text or HTML.
- Choose Encode or Decode.
- The result appears instantly.
- Click Copy.
About HTML Entity Encode / Decode
Escaping HTML is fundamental to preventing broken layouts and cross-site scripting. When you display user-supplied text inside a page, characters like < and > must be escaped so the browser treats them as text, not markup. Decoding is useful when reading escaped content from a database, an API, or scraped HTML. This tool handles the core named entities and runs locally.
FAQ
Why escape HTML?
To display special characters literally and to prevent injected markup or scripts (XSS) when showing user-supplied content.
Which characters get escaped?
The core set is < > & " and '. These are the characters that change how a browser parses HTML.
When should I encode HTML entities?
Encode any user-supplied or dynamic text before inserting it into HTML, so characters like < > & and quotes are shown literally instead of being interpreted as markup. This is a key defence against broken layouts and cross-site scripting.