Show HTML as text, safely
Browsers treat <, > and & as the start of tags and entities, so to display them as text you must write them as HTML entities: <, > and &. Escaping these characters (plus quotes inside attributes) is also the core defense against cross-site scripting when you insert user input into a page.
By default the encoder escapes only the five special characters. Choose also non-ASCII to convert characters like ©, é, ₹ and emoji into entities too — using readable named entities such as © where they exist, and numeric codes otherwise — for systems that can't handle UTF-8.
How to encode HTML entities
- 1
Paste your text or HTML
Code samples, user input or any text.
- 2
Choose what to encode
Only special characters, or non-ASCII too.
- 3
Copy the result
Paste it into your HTML.
Key features
XSS-safe escaping
Covers &, <, >, double and single quotes.
Non-ASCII option
Encode accented letters, symbols and emoji.
Named entities
Uses ©, — and friends where available.
Two-way
Swap to decode with one click.
Common uses
- Code tutorials: Show HTML snippets inside a blog post.
- Email templates: Make special characters render in every email client.
- XML and RSS: Escape text for feeds and XML files.
Tips and good to know
- Modern pages served as UTF-8 don't need non-ASCII characters encoded; escaping the five special characters is enough.
- To reverse the process, use the HTML Entity Decoder.
