HTML Entity Encoder/Decoder
Encode special characters to HTML entities and decode them back to readable text.
Paste plain text to encode or HTML entities to decode.
Your encoded or decoded result appears here.
Click any entity to copy it to your clipboard.
HTML Entity Encoder/Decoder — Convert HTML Entities Online for Free
Our free HTML Entity Encoder/Decoder lets you convert between special characters and their HTML entity equivalents instantly. Encode text to safely display HTML tags, symbols, and special characters on web pages — or decode HTML entities back to readable text. Everything runs in your browser with zero data transfer.
What Are HTML Entities?
HTML entities are special codes used in HTML to represent characters that would otherwise be interpreted as markup. For example, the less-than sign < is used to open HTML tags, so to display a literal < on a webpage you must write < instead. Similarly, & becomes &, " becomes ", and © becomes ©.
There are three types of HTML entities:
- Named entities use a readable name, like
for a non-breaking space oréfor é. - Decimal numeric entities use the character's Unicode code point in decimal, like
©for ©. - Hexadecimal numeric entities use the code point in hex, like
©for ©.
All three forms produce the same result in the browser. The choice between them usually comes down to readability and compatibility. Named entities are easiest to read, while numeric entities work for any Unicode character — even those without a named entity.
How to Use This Tool
- Paste your text in the input area — this can be plain text you want to encode, or HTML entities you want to decode.
- Click "Encode" to convert special characters to their HTML entity equivalents. For example,
<div>becomes<div>. - Click "Decode" to convert HTML entities back to their original characters. For example,
&becomes&. - Copy the result to your clipboard with one click.
The tool supports named entities, decimal numeric entities ({), and hexadecimal numeric entities (💩). It handles the full Unicode range including emojis.
Key Features
| Feature | Benefit |
|---|---|
| Bidirectional conversion | Encode text to entities or decode entities to text |
| Named entity support | Uses readable names like © instead of numeric codes |
| Numeric entity support | Handles both decimal (©) and hex (©) formats |
| Full Unicode coverage | Encodes and decodes any character including emojis |
| Bulk processing | Convert entire blocks of text at once |
| Zero data transfer | All processing happens locally in your browser |
Unlike many encoder tools that only handle the five basic XML entities (&, <, >, ", '), our tool supports the full HTML5 named entity list — over 2,000 entities — and falls back to numeric encoding for any character without a named entity.
Real-World Use Cases
Displaying HTML Code on a Web Page
If you want to show HTML source code as text on a webpage — for example in a blog post or tutorial — you must encode the angle brackets. Writing <div class="example"> renders as <div class="example"> in the browser without being parsed as an actual HTML element.
Preparing Content for XML and RSS Feeds
XML parsers interpret < and & as markup. Any content containing these characters must be encoded before being placed inside XML elements. This is especially important for RSS feeds, Atom feeds, and sitemap files.
Encoding Email Content
HTML emails often require entity encoding for special characters to render correctly across different email clients. Characters like ©, ®, ™, and — are safer when encoded as entities.
Sanitizing User Input
When displaying user-generated content on a webpage, encoding HTML entities prevents cross-site scripting (XSS) by neutralizing tags like <script>. This is a fundamental security practice for any web application.
Common HTML Entities Reference
| Character | Named Entity | Decimal | Hex |
|---|---|---|---|
| & | & |
& |
& |
| < | < |
< |
< |
| > | > |
> |
> |
| " | " |
" |
" |
| ' | ' |
' |
' |
| © | © |
© |
© |
| ® | ® |
® |
® |
| ™ | ™ |
™ |
™ |
| — | — |
— |
— |
| non-breaking space | |
  |
  |
For URL encoding, use our URL Encoder/Decoder instead. For Base64 encoding, try the Base64 Encoder/Decoder.
Tips for Working with HTML Entities
- Always encode
<,>,&,", and'when inserting untrusted text into HTML. These five characters are the minimum required to prevent XSS and rendering errors. - Use named entities for readability.
©is easier to read in source code than©or©. - Prefer numeric entities for maximum compatibility. Some older systems do not support all named entities, but numeric entities work everywhere.
- Double-encoding is a common mistake. Encoding already-encoded text turns
&into&amp;. Always decode first, then re-encode. - Test with real content. Characters like smart quotes, em dashes, and accented letters often cause encoding issues. Paste real content into this tool to verify it encodes and decodes correctly.
Frequently Asked Questions
Is this tool free to use?
Yes. The HTML Entity Encoder/Decoder is completely free, requires no account, and has no usage limits.
Does the tool send my text to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. Your text is never transmitted over the network.
What is the difference between HTML encoding and URL encoding?
HTML encoding replaces special characters with HTML entities like < so they can be safely displayed on a webpage. URL encoding replaces special characters with percent-encoded values like %3C so they can be safely included in a URL. They serve different purposes and produce different output. Use our URL Encoder/Decoder for URL-safe encoding.
Does this tool support all Unicode characters?
Yes. The encoder handles the full Unicode range, including emojis, CJK characters, mathematical symbols, and other special characters. Characters without a named HTML entity are encoded using their numeric code point.
Can I encode and decode in bulk?
Yes. Paste any amount of text — paragraphs, code blocks, or entire files — and the tool will encode or decode all entities at once.
Why does my decoded text look different from the original?
This can happen if the original text contained characters that were double-encoded, or if different entity formats were mixed (named vs. numeric). Try decoding the text twice to see if it was double-encoded.