HTML Entity Encoder / Decoder
Escape text to HTML entities or decode entities back to characters.
Display reserved HTML characters as text—or decode them
Encode characters such as ampersands, angle brackets and quotes so browsers treat them as text, or decode named and numeric entities.
Encode entities
mode
0 B
input size
—
output size
Text or HTML entities
0 charactersEntity result
No outputEntity encoding changes text representation; it is not a complete HTML sanitizer for untrusted markup.
About the HTML Entity Encoder / Decoder
Certain characters such as <, >, & and quotes have special meaning in HTML. Escaping them as entities lets you show them as text instead of markup.
This tool encodes text into safe HTML entities, or decodes named and numeric entities back into the original characters.
It is handy for displaying code snippets and preventing reserved characters from being parsed as markup in an HTML text context. Entity encoding alone is not a universal HTML sanitizer. Everything runs in your browser.
Key features
- Encode special characters to HTML entities
- Decode named and numeric entities
- Handles &, <, >, quotes and more
- Copy, download or reuse the result
- Clear warning that entity encoding is not full sanitization
- Runs locally
How to use
- 1Paste text or entities, or load the realistic sample.
- 2Choose Encode entities or Decode entities.
- 3Copy, download or reuse the transformed result.
Examples
<div>Tom & Jerry</div><div>Tom & Jerry</div>Characters like <, > and & become entities so they show as text, not markup.
Frequently asked questions
- Why should I escape HTML?
- Escaping prevents reserved characters from being treated as markup in an HTML text context. Other contexts such as attributes, URLs, CSS and JavaScript need their own validation and encoding rules.
- Does it decode numeric entities?
- Yes. It decodes both named entities like & and numeric ones like ' or '.
- Is my text uploaded anywhere?
- No. Encoding and decoding run entirely in your browser, so your text never leaves your device.
Continue your workflow
Open a related tool to prepare your files or refine the finished result.
- Featured toolDeveloper ToolsURL Encoder / Decoder
Percent-encode or decode URLs and query strings.
Open tool - Featured toolDeveloper ToolsBase64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text.
Open tool - Featured toolDeveloper ToolsJSON Formatter
Format, validate and minify JSON instantly.
Open tool
