HTML Entities
Encode special characters to HTML entities, or decode entities back to plain text. Private and browser-based.
How HTML Entities works
Encoding: the five characters that matter
To show text literally in HTML, such as a code sample, a user comment, or a string containing <, five characters must be escaped: & becomes &, < becomes <, > becomes >, " becomes ", and ' becomes '. The ampersand is replaced first so existing text is never double-escaped by the tool itself.
Everything else, including accented letters and emoji, is left as is. Modern pages are served as UTF-8 and display those characters directly, so converting them to entities only makes the source harder to read. The result is safe both between tags and inside quoted attribute values.
Decoding
Decoding uses your browser's own HTML parser, so it understands every entity the browser does: all named entities such as , é, and —, decimal references like —, and hex references like —. This is the quickest way to clean text scraped from web pages or exported from a CMS, where & and ' often end up in CSV cells.
A non-breaking space decodes to the U+00A0 character, which looks like a space but does not match a normal space in searches or comparisons. If matching fails after decoding, replace it with a regular space in Find & Replace.
What this is not
Escaping is the right defense when inserting text into HTML, but it is not a sanitizer for HTML you intend to render. To show user-written Markdown or HTML safely, sanitize the generated markup, as the Markdown Preview does with DOMPurify. For text going into URLs, use URL encoding instead.
Example
The tag is shown as text instead of becoming a link, and both kinds of quote are escaped.
<a href="/search?q=R&D">Tom's "R&D" notes</a><a href="/search?q=R&D">Tom's "R&D" notes</a>How to use HTML Entities
- 1
Choose Encode or Decode.
- 2
Paste the text or the entity-encoded HTML.
- 3
Check the result.
- 4
Copy it into your template, CMS, or data file.
When to use it
Code samples in articles
Escape HTML or XML snippets so they display as text inside a <pre> block.
Cleaning scraped data
Decode &, ', and left in titles and descriptions exported from websites.
HTML Entities questions
Why isn't é converted to é?
Only characters with special meaning in HTML are escaped. UTF-8 pages display é directly, so encoding it is unnecessary.
Can I decode &amp; that was escaped twice?
Yes, by decoding twice: the first pass gives &, the second gives &.
Does decoding run any HTML or scripts?
No. The text is decoded inside a textarea element, which never runs scripts or loads resources.
Questions about privacy, file size, or accounts are answered on the FAQ page.
More encode & decode
Other tools in the same category
URL Encode / Decode
Percent-encode text for use in a URL, or decode percent-encoded query strings and paths
Base64 Encode / Decode
Encode text to Base64 or decode Base64 back to text, with full UTF-8 support
Markdown Preview
Live GitHub-flavored Markdown preview with sanitized HTML output, Copy HTML, and print to PDF