HTML Entity Encoder / Decoder
Escape HTML special characters and convert entities back to text.
Converted markup will appear here.
About the HTML Entity Encoder / Decoder
Displaying code or user text inside a web page requires escaping. If angle brackets and ampersands are left raw, the browser interprets them as markup, which breaks the page and opens the door to script injection. This tool converts those characters into safe entities and back again.
It is equally useful in reverse, when a feed or database column has arrived full of entity references that you need to read as plain text.
How to use the HTML Entity Encoder / Decoder
- 1Choose Encode to escape text, or Decode to expand entities.
- 2Paste your content.
- 3Optionally escape quotes as well when the text will sit inside an attribute.
- 4Copy the converted output.
Features
- Escapes ampersands, angle brackets and quotes
- Decodes named and numeric entity references
- Optional attribute-safe mode
- Handles long documents without freezing
- Copy and swap controls
Why people use it
- Show code samples on a page without breaking the layout.
- Reduce cross-site scripting risk when rendering user text.
- Clean up double-escaped content from an old system.
Common use cases
- Preparing an HTML snippet to display inside a tutorial.
- Decoding entity-laden text exported from a legacy database.
- Escaping a value that will be inserted into an attribute.
Privacy and your data
Encoding and decoding are performed in your browser only.
Frequently asked questions
Related tools
JSON Formatter
Beautify, minify and inspect JSON with clear error reporting.
JSON Validator
Check whether JSON is valid and locate the exact syntax error.
Base64 Encoder / Decoder
Encode text to Base64 and decode Base64 back to text.
URL Encoder / Decoder
Percent-encode and decode URLs, paths and query values.
UUID Generator
Generate random version 4 UUIDs in bulk.
Timestamp Converter
Convert Unix timestamps to readable dates and back again.