HTML Encoder
Escape HTML entities.
About this tool
Paste text or markup and get it with the five HTML-significant characters escaped: & < > " and '. Use it to show code in a page or to neutralise user text before putting it in HTML.
How to use
How it works
Each of the five characters is replaced by a named or numeric entity: & becomes &, < becomes <, > becomes >, a double quote becomes " and a single quote becomes '. Other characters, including accented letters, are left as they are.
Worked example
Escaping a link
- Input
- <a href="x">Tom & Jerry's</a>
- Output
- <a href="x">Tom & Jerry's</a>
- Walkthrough
- Pasted into an HTML page, the output displays the tag text instead of making a link.
Limitations
- Only the five characters above are escaped. Non-ASCII characters stay as they are.
- It is an escaper for text nodes and quoted attributes, not a full HTML sanitizer.
Questions
How do I escape HTML characters?
Does escaping prevent XSS?
Does it convert é to é?
How do I reverse it?
Features
- Five-character escape
- Named and numeric entities
- Runs in your browser
Related resources
Guides and videos from around the web—opens on YouTube or the publisher’s site.
Learn JSON - Full Crash Course for Beginners
freeCodeCamp.org
Encoded blobs often wrap JSON payloads in transit.
Watch on YouTubeTypeScript in 100 Seconds
Fireship
Typed JS snippets often get formatted or hashed nearby.
Watch on YouTube
- Base64
MDN
Glossary definition and when Base64 is appropriate versus binary transfer.
- MDN Web Docs
MDN
Primary reference for web APIs these developer tools touch.