HTML Entity Encoder / Decoder
Encode special characters as HTML entities (named, decimal or hex) and decode entities back to text, with a reference table of common entities.
Input
Output
Settings
History (Last 20)
Related tools
What HTML Entities Are and When to Use Them
A browser reads < as the start of a tag and & as the start of an entity, so those characters cannot appear as plain text in HTML. An HTML entity writes such a character as a code the browser displays but never treats as markup.
Named: &name; < é €
Decimal: &#number; < é €
Hex: &#xhex; < é €
The number in a numeric reference is the character's Unicode code point, so every character, including emoji, has one. Only about 2,200 characters have a name, and names are case-sensitive: É is É and é is é.
On a modern page saved as UTF-8, you only need to escape & and < in text, plus the quote character that wraps an attribute value. Typing é, € or — directly is fine and easier to read; entities for them are for older systems, some email templates, and places where the source must stay plain ASCII.
Common HTML Entities Chart
| Char | Named | Decimal | Hex | Meaning |
|---|---|---|---|---|
| & | & | & | & | Ampersand (must be escaped) |
| < | < | < | < | Less-than sign (must be escaped) |
| > | > | > | > | Greater-than sign |
| " | " | " | " | Double quote (in attributes) |
| ' | ' | ' | ' | Apostrophe (' in HTML5) |
| (space) | |   |   | Non-breaking space |
| © | © | © | © | Copyright sign |
| ® | ® | ® | ® | Registered trademark |
| ™ | ™ | ™ | ™ | Trademark |
| € | € | € | € | Euro sign |
| £ | £ | £ | £ | Pound sign |
| ¥ | ¥ | ¥ | ¥ | Yen sign |
| ¢ | ¢ | ¢ | ¢ | Cent sign |
| ° | ° | ° | ° | Degree sign |
| ± | ± | ± | ± | Plus-minus |
| × | × | × | × | Multiplication sign |
| ÷ | ÷ | ÷ | ÷ | Division sign |
| ½ | ½ | ½ | ½ | One half |
| – | – | – | – | En dash (ranges: 9–5) |
| — | — | — | — | Em dash |
| … | … | … | … | Ellipsis |
| “ ” | “ ” | “ ” | “ ” | Curly double quotes |
| ‘ ’ | ‘ ’ | ‘ ’ | ‘ ’ | Curly single quotes |
| « » | « » | « » | « » | Guillemets (French, German quotes) |
| • | • | • | • | Bullet |
| → | → | → | → | Right arrow |
| ≤ ≥ | ≤ ≥ | ≤ ≥ | ≤ ≥ | Less / greater than or equal |
| é | é | é | é | e with acute accent |
| ü | ü | ü | ü | u with umlaut |
| ñ | ñ | ñ | ñ | n with tilde |
| ß | ß | ß | ß | German sharp s |
| 😀 | — | 😀 | 😀 | Emoji (numeric references only) |
Escaping in Practice
- Showing code on a page:
<div class="box">must be written as<div class="box">inside a<pre>or<code>block, or the browser will render an actual div. - Attribute values: in
title="Say "hi""the inner quotes must be escaped, or they end the attribute early. - Double escaping: text that shows
&or<on screen was escaped twice, often once by a CMS and once by a template. Decode it one level at a time here to find where it happened. - Security: escaping stops user text from being read as HTML, but JavaScript, URLs and CSS need their own escaping. Frameworks such as React, Vue and Django escape text for you; avoid bypasses like
dangerouslySetInnerHTMLfor user input.
How to Use the HTML Entity Encoder
- 1Paste your text: Paste HTML, code or text into the input box; a sample is loaded so you can see the result straight away.
- 2Choose a mode: Pick Encode to turn characters into entities, Decode to turn entities back into characters, or Auto to let the tool decide from the text.
- 3Pick the entity format: Choose named entities (<), decimal references (<) or hexadecimal references (<), and tick the option to also encode accented letters, symbols and emoji if your page or email is not UTF-8.
- 4Copy the result: Copy the converted text or export it as a TXT file; conversions you copy or export are kept in the history for later.
Frequently Asked Questions
What is an HTML entity?
A code that stands for a character in HTML. It starts with & and ends with a semicolon: < is <, & is &, and © is ©. Browsers show the character, but the code itself cannot be mistaken for markup.
Which characters must be escaped in HTML?
The ampersand (&) and the less-than sign (<) in text, and quotes inside attribute values (" as ", ' as '). Escaping > as > is not required but is common practice. All other characters can be written as they are on a UTF-8 page.
What is the difference between named, decimal and hex entities?
They are three ways to write the same character. Named entities use a word (é), decimal references use the Unicode code point in base 10 (é) and hex references use it in base 16 (é). Every character has a numeric reference, but only some have a name.
What does mean?
A non-breaking space (U+00A0). It looks like a normal space but keeps the words on either side on the same line, for example between a number and its unit (10 kg), and it is not collapsed when several are written in a row.
Do I need to encode accented letters like é or symbols like €?
Not on a page saved and served as UTF-8, which is the standard today: write é and € directly. Encode them only for systems that use another character set, some older email clients or when you must keep a file pure ASCII.
Why does &lt; show as < instead of <?
Because it was encoded twice: & became & and the result was encoded again. Decoding once gives <, and decoding again gives <. This tool decodes exactly one level, so you can see and fix double-escaped text.
Does encoding HTML entities protect against XSS?
Escaping text before putting it into HTML is one essential layer, but safety depends on the context: text in a <script> block, a URL or a CSS value needs different escaping. Use your framework's built-in escaping or a sanitizer for user input rather than escaping by hand.
Is my data private?
Yes. We do not collect or store what you enter. Any history the tool keeps is visible only to you.
Related Tools
Morse Code Translator
Translate text and Morse code with audio playback and custom symbol settings.
Text-to-Slug Converter
Convert single or bulk titles into SEO-friendly URL slugs.
URL Encoder/Decoder
Convert special characters in URLs to %xx format.
Markdown Previewer
Live Markdown editor with GitHub tables and task lists, and HTML export.
Base64 Encoder/Decoder
Convert text to/from Base64 strings.
JSON Formatter & Beautifier
Beautify or minify JSON, highlight syntax errors, and explore nested structure with tree view.
Word Counter
Count words, characters, sentences, paragraphs, and reading time.
Sentence Case Converter
Convert text to uppercase, lowercase, title case, or sentence case.
Paragraph Formatter
Clean text by fixing spaces, line breaks, and paragraph structure.
Keyword Density Checker
Analyze keyword frequency and density percentages for SEO writing.
Text Reverser Tool
Reverse letters, words, sentences, or paragraph order instantly.
Text to Clipboard Copy
Copy one or multiple text blocks in plain, HTML, or Markdown format.