HTML Entity Encoder/Decoder
Encode and decode HTML entities including named and numeric formats. Convert special characters for safe HTML display with a handy entity reference table.
Text to Encode
HTML Entities
Common HTML Entities Reference
| Character | Description | Named | Numeric |
|---|---|---|---|
< | Less than | < | < |
> | Greater than | > | > |
& | Ampersand | & | & |
" | Double quote | " | " |
' | Single quote | ' | ' |
(space) | Non-breaking space | |   |
© | Copyright | © | © |
® | Registered | ® | ® |
™ | Trademark | ™ | ™ |
€ | Euro sign | € | € |
£ | Pound sign | £ | £ |
– | En dash | – | – |
— | Em dash | — | — |
• | Bullet | • | • |
… | Ellipsis | … | … |
← | Left arrow | ← | ← |
→ | Right arrow | → | → |
About HTML Entity Encoding
HTML entity encoding converts special characters into their HTML entity equivalents, preventing them from being interpreted as HTML markup. This is essential for displaying characters like <, >, and & in web pages.
- Named entities use readable names like
&for & - Numeric entities use character codes like
&for & - Encoding prevents XSS (Cross-Site Scripting) attacks in web applications
- All processing happens client-side — your data never leaves your browser
How to Use the HTML Entity Encoder/Decoder
- 1Choose between Encode mode to convert characters to HTML entities or Decode mode to convert entities back
- 2Paste or type your text into the input area on the left
- 3For encoding, select Named entities (&) or Numeric (&) format
- 4Optionally enable "Encode all non-ASCII characters" to convert accented letters, symbols, and emoji
- 5View the result in the output panel and click "Copy Result" to copy
- 6Use the Swap button to quickly reverse the operation with your current output
Frequently Asked Questions
What are HTML entities and why do I need to encode them?
HTML entities are special sequences that represent characters which have meaning in HTML markup, such as < (less than), > (greater than), and & (ampersand). Encoding them prevents browsers from interpreting them as HTML tags or syntax, and also protects against XSS (Cross-Site Scripting) attacks.
What is the difference between named and numeric HTML entities?
Named entities use human-readable names like & for & and < for <. Numeric entities use the Unicode code point like & for & and < for <. Named entities are easier to read, but numeric entities can represent any Unicode character, even those without a named entity.
Which characters must always be encoded in HTML?
The five characters that must always be encoded in HTML content are: & (ampersand), < (less than), > (greater than), " (double quote, inside attributes), and ' (single quote/apostrophe, inside attributes). Failing to encode these can break your HTML or create security vulnerabilities.
Can I use this tool for escaping HTML in code?
Yes! This tool is perfect for escaping HTML snippets that you want to display as text on a web page, in blog posts, documentation, or code examples. Simply paste your HTML code in Encode mode and the output will be safe to embed in any HTML document.
Is my data secure when using this tool?
Absolutely. All encoding and decoding happens entirely in your browser using client-side JavaScript. Your text is never sent to any server, ensuring complete privacy and security for sensitive content.
Related Tools
JSON Formatter & Validator
Format, validate, and beautify JSON data with syntax highlighting. Perfect for debugging API responses and configuration files.
Base64 Encoder/Decoder
Encode and decode text to/from Base64 format. Essential tool for data transmission, email attachments, and web development.
URL Encoder/Decoder
Encode and decode URL components for safe transmission. Handle special characters, query parameters, and URL formatting.
Need More Developer Tools?
Explore our complete collection of free online developer utilities
View All Tools