HTML Entity Encoder & Decoder
Convert special characters to HTML entities (named or numeric) or decode entities back to their original characters. Essential for preventing XSS and displaying HTML safely.
Common HTML Entities Reference
| Character | Named Entity | Numeric Entity | Description |
|---|---|---|---|
| & | & | & | Ampersand |
| < | < | < | Less than |
| > | > | > | Greater than |
| " | " | " | Double quote |
| ' | ' | ' | Single quote |
| |   | Non-breaking space | |
| © | © | © | Copyright |
| € | € | € | Euro sign |
What are HTML entities?
HTML entities are special codes used to represent characters that have meaning in HTML syntax or cannot be typed directly. For example, the less-than sign (<) must be written as < in HTML to prevent the browser from interpreting it as the start of a tag.
There are two formats: named entities (like & for &) which are human-readable, and numeric entities (like &) which use the character's Unicode code point. Both produce the same result in the browser.
FAQs
Why should I encode HTML entities?
Encoding prevents browsers from interpreting special characters as HTML markup. This is critical for preventing Cross-Site Scripting (XSS) attacks and for displaying code snippets correctly on web pages.
What is the difference between named and numeric entities?
Named entities use memorable names like & or <. Numeric entities use the character's Unicode number like &. Named entities are easier to read but not all characters have named versions — numeric entities work for any character.
Is this tool processed server-side?
No. All encoding and decoding happens entirely in your browser using JavaScript. Your text never leaves your device.
Can I encode entire HTML documents?
Yes. Paste any text including full HTML documents. In encode mode, all special characters will be converted to safe HTML entities. This is useful for displaying source code on web pages.
Related Tools
Base64decode Online Encoder & Decoder
Encode or decode Base64 strings directly in your browser
Text Encoder & Decoder
Convert text to Base64 or decode Base64 to plain text
Image to Base64
Convert images to Base64 encoded strings
Base64 to Image
Decode Base64 strings back to viewable images
File to Base64
Encode any file to a Base64 string
Base64 to File
Decode any Base64 string back to its original file
Base64 to PDF
Decode Base64 strings to PDF documents
JWT Decoder
Decode and inspect JWT tokens
URL Encode/Decode
Encode or decode URLs with percent-encoding
Hex ↔ Base64 Converter
Convert between hex and Base64 formats