HTML Entity Encoder/Decoder
Convert special characters such as <, >, &, quotes, and apostrophes into HTML entities, or decode entities back to readable text.
Input
Output
Encode HTML before showing code as text, or decode entities back to readable characters.
How to encode and decode HTML entities
Convert characters that have special meaning in HTML into safe entities, or decode entity text back to readable characters.
When to encode entities
Encode entities when you need to show code as text, paste snippets into a CMS field, or prevent characters like < and & from being interpreted as markup.
How to use it
- Paste HTML, text, or entity-encoded content into the input box.
- Choose Encode to escape special characters.
- Choose Decode to turn entities back into readable text.
- Copy the output when it looks right.
Common uses
- Showing HTML snippets inside documentation.
- Preparing safe text for template examples.
- Cleaning copied content that contains visible entity codes.
Entity notes
Entity encoding helps display HTML-looking text as text. In production apps, still rely on the framework or template engine's escaping rules.
FAQ
What characters are encoded?
The tool encodes the characters most likely to break HTML text: &, <, >, double quotes, and apostrophes.
Can it decode numeric entities?
Yes. It supports common named entities and numeric decimal or hexadecimal entities.
Does encoding sanitize unsafe HTML?
No. It escapes text for display, but it is not a complete HTML sanitizer for untrusted markup.
