HTML Entity Encoder / Decoder
Encode or decode named and numeric HTML entities locally with Unicode support, selectable escaping and safe text output.
HTML entity input
Up to 100,000 characters. HTML entities describe characters in HTML. Use URL Encoder / Decoder for URL components.
Entity output
Understand your results
For developers moving text between literal HTML markup and escaped representations.
The local entities parser handles named and numeric HTML references, including Unicode code points. Encoding can escape essential characters, produce ASCII output, or encode every character numerically. Decoding follows HTML entity rules and renders only text.
How to use this tool
- Choose Encode or Decode and enter the source text.
- For encoding, select the escaping behavior and convert.
- Compare input/output, then copy, download or swap the result for a round trip.
What the observations mean
An HTML reference such as & describes a character in markup. It is a different representation from percent encoding in a URL.
Worked example
Decode a named entity and a Unicode numeric reference.
Café & tea 🍵The displayed plain text is Café & tea 🍵. It is never interpreted as HTML.
Limits and processing
Up to 100,000 input characters. Unknown and malformed references follow the library’s HTML decoding rules, including legacy references without a semicolon. Output is not a sanitization guarantee.
Common problems and practical fixes
- The string becomes double-escaped
- Confirm whether your input is already encoded before running Encode.
- Decoding changes an invalid numeric reference
- HTML decoding rules replace certain invalid code points and map some legacy values.
- The preview is shorter than the output
- Copy and download contain the full result even when the display preview is truncated.
Best practices
Keep track of which layer is encoded and apply escaping for the actual HTML text or attribute context in the receiving application.
Practical tips
- Escape at the final HTML context where text will be used.
- Use URL Encoder / Decoder for URL components rather than HTML references.
Frequently asked questions
Practical answers for using the HTML Entity Encoder / Decoder.
Can decoded script tags execute here?
No. The result is a text node in the output panel and is never inserted as active HTML.
Are numeric Unicode references supported?
Yes, including code points represented by UTF-16 surrogate pairs such as emoji.
Is this an HTML sanitizer?
No. Context-aware output handling is still required when using the converted text in another application.