HTML Entity Encoder
Encode text to HTML entities and decode entities back to plain text, both directions.
Direction
Entity format
Accented letters, symbols, and emoji are converted along with the five markup characters.
Converted live as you type. Everything runs in your browser. Nothing is uploaded.
Common entities
| Character | Named | Numeric |
|---|---|---|
| < | < | < |
| > | > | > |
| & | & | & |
| " | " | " |
| ' | ' | ' |
| space | |   |
| © | © | © |
| ® | ® | ® |
| ™ | ™ | ™ |
| — | — | — |
| € | € | € |
| … | … | … |
Decoding recognises every named entity plus numeric decimal and hexadecimal references. Unknown or incomplete entities are left exactly as written.
How to encode and decode HTML entities online
Choose a direction
Select Encode to turn characters into HTML entities, or Decode to turn entities back into the characters they represent.
Set the entity format
When encoding, pick named, decimal, or hexadecimal output, and toggle whether accented letters, symbols, and emoji are converted too.
Enter your text
Type or paste into the input and the result updates immediately, with no submit step.
Copy the output
Use Copy to clipboard to move the encoded or decoded text wherever you need it.
Why use this tool
Named, decimal, and hex output
Encode to readable named entities like ©, to decimal references like ©, or to hexadecimal references like ©. Switch formats and the whole result re-renders at once.
Full named entity table
The complete set of standard named entities is built in, covering Latin letters, punctuation, currency, arrows, Greek, and math symbols, so decoding recognises names like —, €, and α.
Decodes both kinds in one pass
Decoding turns named entities and numeric references, decimal or hexadecimal, back into characters in a single pass, so you never need to know how a string was produced.
Malformed entities left intact
An unknown name, a lone ampersand, or an out-of-range numeric reference is left exactly as written instead of breaking the result, so partial or hand-edited markup decodes predictably.
Non-ASCII characters covered
Encoding operates on full Unicode code points, so accents, symbols, and emoji become their correct entities and come back intact. A toggle limits encoding to the five markup characters when that is all you want.
Runs entirely in your browser
Everything happens on your device; nothing is uploaded, stored, or logged.
About this tool
This HTML entity encoder works in both directions. Encoding always converts the five characters that carry structural meaning in markup, the ampersand, the less-than and greater-than signs, and both quote marks, and optionally converts every other non-ASCII character too. Decoding reverses the process, turning named entities such as & and numeric references such as © or © back into the characters they stand for.
Reach for it whenever raw text has to sit safely inside HTML: pasting code samples or user text into a page without the browser reading angle brackets as tags, escaping content for an email template, or cleaning up a fragment where entities and plain characters are mixed. Encoding offers named, decimal, and hexadecimal output, and a toggle keeps accented letters and emoji as-is when only the markup characters need escaping. Decoding accepts all three forms at once and leaves anything it does not recognise untouched, so malformed or hand-edited markup never produces a broken result.
To escape text for a link or query string rather than for HTML, use the URL encode and decode tool. To tidy the surrounding markup after decoding, try the HTML formatter, and to turn characters into programming-language escape codes instead of entities, see unicode escape.
Frequently asked questions
- What is an HTML entity?
- An HTML entity is a way to write a character using ordinary text so a browser does not misread it. It starts with an ampersand and ends with a semicolon, either as a name like < or as a numeric reference like < (decimal) or < (hexadecimal). All three represent the same character.
- What is the difference between named and numeric entities?
- Named entities such as © are easier to read, while numeric references such as © or © work for any character even when no name exists. Encoding lets you choose the style; decoding accepts all of them and converts them back to the same character.
- Does it encode accents, symbols, and emoji?
- Yes. With the non-ASCII option on, every character above the basic ASCII range is converted to an entity, using its named form when one exists and a numeric reference otherwise. Turn the option off to escape only the five markup characters and leave the rest of the text as typed.
- What happens with malformed or unknown entities when decoding?
- Anything the decoder does not recognise, such as an unknown name, a stray ampersand, or a numeric reference outside the valid range, is left exactly as written instead of causing an error. This makes it safe to run on partial or hand-edited markup.
- Is my text uploaded anywhere?
- No. Encoding and decoding run entirely in your browser. Your text never leaves your device, is never sent to a server, and is not stored or logged.
Related tools
URL Encode & Decode
Percent-encode text for URLs and decode it back, both directions.
HTML Formatter & Beautifier
Beautify messy or minified HTML with indent, line wrap, and line break control.
Unicode Escape & Unescape
Convert text to and from \uXXXX escape sequences and HTML entities.
API Key Generator
Generate cryptographically random API keys and tokens in hex, base62, or base64url, with control over length, an optional prefix, and bulk output.
ASCII Table Reference
The full ASCII character set with decimal, hex, octal, binary, and HTML codes. Search by code, character, or name.
Atbash Cipher
Mirror the alphabet so A swaps with Z, B with Y, and so on. Atbash is its own inverse, so one field both encodes and decodes as you type.