📄 HTML Entity Encoder & Decoder
Convert special characters to HTML entities and back. Supports named, decimal, and hex entity formats.
Last updated: May 18, 2026 · By Λ
Common HTML Entity Reference
| Char | Named | Decimal | Hex | Description |
|---|---|---|---|---|
| & | & | & | & | Ampersand |
| < | < | < | < | Less than |
| > | > | > | > | Greater than |
| " | " | " | " | Double quote |
| ' | ' | ' | ' | Single quote / apostrophe |
| |   |   | Non-breaking space | |
| © | © | © | © | Copyright |
| ® | ® | ® | ® | Registered |
| ™ | ™ | ™ | ™ | Trademark |
| € | € | € | € | Euro sign |
| £ | £ | £ | £ | Pound sign |
| ¥ | ¥ | ¥ | ¥ | Yen sign |
| ¢ | ¢ | ¢ | ¢ | Cent sign |
| § | § | § | § | Section sign |
| ¶ | ¶ | ¶ | ¶ | Paragraph / pilcrow |
| ° | ° | ° | ° | Degree sign |
| ± | ± | ± | ± | Plus-minus |
| × | × | × | × | Multiplication |
| ÷ | ÷ | ÷ | ÷ | Division |
| ½ | ½ | ½ | ½ | One half |
| ¼ | ¼ | ¼ | ¼ | One quarter |
| « | « | « | « | Left angle quotes |
| » | » | » | » | Right angle quotes |
| … | … | … | … | Horizontal ellipsis |
| • | • | • | • | Bullet |
| ← | ← | ← | ← | Left arrow |
| → | → | → | → | Right arrow |
| ♥ | ♥ | ♥ | ♥ | Heart |
Free HTML Entity Encoder & Decoder
Convert special characters like <, >, &, and quotes into their HTML entity equivalents, or decode entities back into readable characters. Choose between named entities (&), decimal codes (&), or hexadecimal codes (&). Optionally encode every character or just unsafe ones. Use the live preview to see how browsers will render your HTML. The encoding and decoding are a few lines of JavaScript executing right here in the page, so the text you paste stays with you instead of traveling to a server.
What is an HTML Entity Encoder and Decoder?
HTML entities are special codes used to represent characters that have reserved meaning in HTML or that cannot be easily typed on a keyboard. For example, the less-than sign (<) is reserved for opening HTML tags, so to display it as visible text on a webpage you must write it as < instead. Entities can be expressed in three formats: named entities like &, decimal codes like &, and hexadecimal codes like &.
This free tool lets you encode plain text into HTML entities and decode entities back into readable characters. It is particularly useful for web developers who need to safely embed user-generated content in HTML, prepare code snippets for display in blog posts, or decode entity-heavy markup into human-readable text. Everything runs locally in your browser, so your content remains private and is never sent to any server.
How to Use This Tool
- Select "Encode" mode to convert text into HTML entities, or "Decode" mode to convert entities back into readable characters.
- When encoding, choose your preferred entity format: named (&), decimal (&), or hexadecimal (&). Optionally check "Encode all characters" to convert every character, not just unsafe ones.
- Type or paste your text into the input area. The conversion happens automatically as you type, or you can click the "Convert" button.
- Copy the output with the "Copy Output" button. In encode mode, the live preview panel shows how browsers will render your encoded HTML.
Key Features
- Three Entity Formats - Choose between named entities, decimal numeric codes, or hexadecimal numeric codes depending on your needs and compatibility requirements.
- Selective or Full Encoding - Encode only the characters that are unsafe in HTML (such as <, >, &, and quotes), or encode every single character for maximum safety.
- Live HTML Preview - See exactly how browsers will render your encoded output in real time, helping you verify your conversion before using it.
- Entity Reference Table - A built-in reference table lists common HTML entities with their named, decimal, and hex representations for quick lookup.
- Instant Conversion - Results update as you type with no delay, giving you a smooth and responsive editing experience.
Frequently Asked Questions
Why do I need to encode HTML entities?
Encoding prevents browsers from interpreting special characters as HTML markup. Without encoding, a less-than sign could be misread as the start of an HTML tag, potentially breaking your page layout or creating security vulnerabilities such as cross-site scripting (XSS). Encoding ensures that special characters display correctly as visible text.
What is the difference between named, decimal, and hex entities?
Named entities like & are human-readable and easy to remember, but not every character has a named entity. Decimal codes like & and hex codes like & can represent any Unicode character. All three formats are valid HTML and render identically in browsers. Named entities are most commonly used for well-known characters, while numeric codes are needed for less common symbols.
Should I encode all characters or just unsafe ones?
For most purposes, encoding only the five unsafe characters (<, >, &, double quote, single quote) is sufficient. Encoding all characters produces a much longer output but can be useful in specific situations where you need to ensure that no character could be misinterpreted by a parser or when working with systems that have limited character set support.
Can I decode entities from any source?
Yes. The decoder handles named entities, decimal codes, and hexadecimal codes. You can paste entity-encoded text from any source, including HTML source code, email headers, or API responses, and the tool will convert it back into readable characters.