HTML Entity Encoder / Decoder
Encode & decode HTML entities
What Is This Tool?
This tool converts plain text into HTML entities (so special characters render safely inside HTML markup) and decodes HTML entities back to plain text. It covers the core XML-safe characters, a set of common named entities, and generic numeric entities, entirely in your browser.
How to Use
Type or paste text into the Text field, then click Encode to convert special characters to HTML entities.
Or paste HTML-entity-encoded text into the HTML Entities field and click Decode.
Use Swap to flip the two fields' contents.
Copy either field's contents with its own Copy button.
Features
- Encodes the 5 XML-safe characters (&, <, >, ", ')
- Encodes common named entities like ©, ™, — when present
- Falls back to numeric entities for other non-ASCII characters
- Decodes named entities plus numeric decimal and hex entities
- 100% client-side — nothing leaves your browser
Examples
Text: <Café> & co. — 100% free
HTML Entities: <Café> & co. — 100% free
Common Use Cases
- Safely embedding user-supplied text inside HTML markup
- Decoding HTML-entity-encoded content copied from a CMS or email
- Preparing text for an XML document that requires the 5 core entities
- Debugging garbled special characters in scraped or exported HTML
Frequently Asked Questions
Which characters get encoded?
The five XML-safe characters (&, <, >, ", ') are always encoded. Recognized non-ASCII characters like é, ©, ®, ™, — and … are encoded as named entities; any other non-ASCII character falls back to a numeric entity like €.
What named entities does Decode understand?
Decode covers the most common HTML5 named entities (about 40, including &, <, >, ", ', , ©, ®, ™, accented letters, and more), plus any numeric decimal (') or hexadecimal (') entity.
Why does my encoded output still contain non-ASCII characters?
Only characters without a common named entity fall back to numeric encoding; everything else (plain ASCII letters, digits, punctuation not in the special set) is left as-is since it's already safe in HTML.
What does Swap do?
It swaps the current contents of the Text and HTML Entities fields, which is handy for quickly reversing a previous encode or decode.
Is my text uploaded anywhere?
No, everything happens locally in your browser using plain JavaScript string processing.