HTML Entity Encoder/Decoder | Free Tool - DevToolKit
Free HTML entity encoder and decoder. Convert special characters to HTML entities and back. Supports named and numeric entities.
Common HTML Entities
| Character | Named | Numeric | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| ' | ' | ' | Single quote |
| (space) | |   | Non-breaking space |
| © | © | © | Copyright |
| ® | ® | ® | Registered |
| ™ | ™ | ™ | Trademark |
| – | – | – | En dash |
| — | — | — | Em dash |
| … | … | … | Ellipsis |
What is HTML Entity Encoder?
How to Use HTML Entity Encoder
Enter text in the input area. Click "Encode" to convert special characters (like <, >, &, ", ') into their HTML entity equivalents. Click "Decode" to convert HTML entities back to their original characters. Choose between named entities (like &) and numeric entities (like &). A reference table of common entities is displayed below.
How HTML Entity Encoder Works
Common Use Cases
- Encoding user input before inserting it into HTML to prevent XSS
- Displaying code snippets in HTML without the browser interpreting them
- Converting special characters for use in HTML emails
- Decoding HTML entities found in scraped web content
- Preparing text for insertion into HTML attributes
Frequently Asked Questions
What are HTML entities?▼
HTML entities are special codes that represent characters which have special meaning in HTML or cannot be easily typed. They start with & and end with ;. For example, < represents <, > represents >, and & represents &.
What is the difference between named and numeric entities?▼
Named entities use descriptive names (like & for &), while numeric entities use the Unicode code point number (like & for &). Named entities are more readable, but numeric entities can represent any Unicode character.
Why should I encode HTML entities?▼
Encoding HTML entities prevents the browser from interpreting special characters as HTML markup. This is essential for displaying code in web pages and for preventing Cross-Site Scripting (XSS) attacks when displaying user-generated content.
Is my data processed on a server?▼
No. All encoding and decoding happens entirely in your browser using JavaScript. No data is sent to any server.