HTML Entity Encode / Decode
Free HTML entity encoder and decoder. Escape special characters and non-ASCII text to HTML entities and decode them back — instantly and privately in your browser.
🔒 All encoding and decoding happens in your browser — your text is never uploaded.
Free HTML Encoder / Decoder
This free online tool lets you HTML encode any text — escaping the special characters
&, <, >, " and ' into safe HTML
entities — and just as easily decode entities back into normal text. It handles both named
entities (like &) and numeric ones (like ' or '),
works instantly as you type, and runs entirely in your browser.
How to use the HTML entity encoder
- Choose a mode: Encode → Entities to escape text, or Decode → Text to unescape it.
- Type or paste your text into the left box (or click Load sample).
- The result appears on the right instantly — click Copy to grab it.
- When encoding, tick Convert all non-ASCII to &#nnn; to turn accented and Unicode characters into numeric entities.
- Click Use result as input to flip the output back through the other mode.
What are HTML entities and why escape them?
In HTML, a handful of characters carry special meaning. The browser uses < and >
to mark the start and end of tags, & to begin an entity, and quotation marks to wrap attribute
values. If you want to display those characters as literal text instead of having the browser interpret
them as code, you replace each one with its HTML entity. The five core entities are
& for &, < for <, > for >,
" for a double quote and ' for an apostrophe.
Escaping matters most for security. When user-supplied text is dropped into a page without
encoding, an attacker can inject <script> tags and run code in other people’s browsers
— a cross-site scripting (XSS) attack. Encoding the five special characters neutralises that markup so it
shows up as plain text. The same technique is essential when you want to display code samples,
put raw HTML inside a tag, or store snippets safely in a database or JSON file.
Frequently asked questions
Is this HTML encoder free and private?
Which characters does HTML encoding escape?
&, the less-than sign becomes <, the greater-than sign becomes
>, the double quote becomes " and the apostrophe becomes
'. You can also choose to convert every non-ASCII character to a numeric entity.Does it decode both named and numeric entities?
& and
©, decimal numeric entities like ', and hexadecimal ones like
'. It turns each one back into the original character.