HTML Entity Encoder
Encode and decode HTML entities to escape or unescape markup.
HTML Entity Encoder
The HTML entity encoder escapes characters like <, >, &, and quotes into their HTML entity equivalents, and decodes entities back into plain characters. Escaping is essential whenever you want to display code or user-generated text on a page without the browser interpreting it as markup, which also helps prevent broken layouts and injection issues.
How it works
Encoding and decoding run locally in your browser with JavaScript. Paste raw text to convert reserved characters into named or numeric entities, or paste entity-laden HTML to unescape it back into readable characters. Because it is client-side, there is no upload and the output updates as you type.
Practical use cases
- Escape a code snippet so it renders literally inside a
<pre>block. - Sanitize display text so tags are shown rather than executed.
- Decode entity-encoded content scraped from HTML back into plain text.
- Prepare examples for documentation and tutorials.
When working with full documents, the HTML Beautifier tidies your markup, and HTML to Markdown converts it to Markdown. For URL-safe escaping, reach for the URL Encode / Decode tool instead.
Private by design
Your text is escaped and unescaped in-browser and never uploaded. The tool is free, requires no account, and works on all modern browsers including mobile, so you can encode and decode HTML entities while keeping your content on your own device.
Frequently asked questions
Reserved HTML characters such as <, >, &, single quotes, and double quotes are converted into their entity equivalents so they display literally instead of being parsed as markup.
Related tools
Base64 Encode / Decode
Encode text to Base64 and decode it back, with full Unicode support.
Base64 to Image
Preview and download an image from a Base64 or data-URI string.
Image to Base64
Turn any image into a Base64 data URI for CSS, HTML or JSON.
URL Encode / Decode
Percent-encode and decode URLs and query-string components safely.