How to use the HTML Entity Encoder & Decoder
- 1
Paste or type your input.
- 2
Choose the operation and options.
- 3
Copy the output or download it as a file.
Why escape HTML
Escaping prevents text from being interpreted as markup, which is essential when showing user input or code samples in a web page.
Which characters must be escaped
Five characters can break HTML: < and > start and end tags, & starts an entity, and " and ' end attribute values. Writing them as < > & " and ' makes the browser show them as text. Escaping is the basic defence against cross-site scripting when you place user-supplied text into a page.
Named and numeric entities
Entities come in two forms. Named ones such as © and are easier to read; numeric ones such as © or © work for every Unicode character. Modern pages saved as UTF-8 can include most characters directly, so you usually only need to escape the five special characters.
Frequently asked questions
Is my data sent to a server?
No. Everything runs in your browser as you type. Nothing is uploaded or logged, so it is safe to paste API responses, tokens and private text.
Why do I see &amp; on my page?
The text was escaped twice. Decode it once here to get &, which a browser displays as &.
Is escaping enough to stop XSS?
Escaping text placed between tags is the main step, but values inside attributes, URLs and scripts need context-specific handling too. Use your framework's built-in escaping where possible.
What is ?
A non-breaking space: it looks like a normal space but stops the line from breaking at that point, for example between a number and its unit.
Something not working, or missing a setting you need? Report a problem or request a tool.