Use this free HTML entity encoder to turn special characters into entities that display safely in a web page, or decode entities back into plain text. Paste your text, choose Encode or Decode, pick an entity style, and click Convert. You can copy the result or download it as a .txt file.
Encoding the characters that HTML treats as markup prevents broken layouts and helps keep user-supplied text from being read as code.
How to use the HTML entity encoder
- Paste your text: drop in an HTML snippet, a line of user content, or a block of entity-encoded text.
- Choose a mode: Encode converts characters into entities, and Decode converts entities back into characters.
- Pick a style: named entities are the most readable, decimal and hex are useful when a name is not available.
- Convert and copy: copy the result to your clipboard or save it as a .txt file.
What the tool does
| Action | Best for | What you get |
|---|---|---|
| Encode essential | Showing HTML code as text on a page | &, <, >, " and ' converted to entities |
| Encode all | Safe, ASCII-only HTML source | Accented letters, symbols, and currency signs also converted |
| Decode | Reading entity-encoded text | Named, decimal, and hex entities turned back into characters |
| Style | Matching your codebase or template | Named, decimal, or hex output for the same characters |
Common HTML entities
| Character | Named | Decimal | Hex |
|---|---|---|---|
| & | & | & | & |
| < | < | < | < |
| > | > | > | > |
| " | " | " | " |
| ' | ' | ' | ' |
| © | © | © | © |
| € | € | € | € |
Common mistakes
- Double encoding: encoding text that is already encoded turns
&into&amp;, which displays as&. Decode first if you are unsure. - Encoding whole documents: encode only the text content. Encoding tags such as
<div>that you meant as markup stops them from working. - Mixing up encodings: HTML entities are not URL encoding. Use a URL encoder for query strings and paths.
- Assuming non-breaking spaces:
is a space that does not wrap, not a regular space character, so it can affect text matching and copying.
Encoding user input before it is placed in HTML is one of the simplest ways to keep a page displaying what you intended.
Worked examples
Encode a snippet for display
Paste <b>Tom & Jerry</b> and click Convert with Encode and Essential only. The tags and ampersand are converted, so the text can be shown on a page without being rendered as bold markup.
Encode accented text with hex output
Paste café, choose Hex with All non-ASCII too, and click Convert. The é becomes a hexadecimal entity, which is useful when your template should stay plain ASCII.
Decode a block of entities
Paste Price: €12 & up and switch to Decode. The result is Price: €12 & up, with the entities turned back into their characters.
Frequently asked questions
Is this HTML entity encoder free to use?
Yes. You can encode, decode, copy, and download text without creating an account.
Is my text uploaded or stored?
No. All processing happens in your browser. Nothing you paste is sent to a server or saved, and clearing the form removes it from the screen.
What is the difference between named, decimal, and hex entities?
Named entities use a readable name, decimal entities use a base-10 number, and hex entities use a base-16 number. All three display the same character in a browser.
Does encoding change how my text looks on a page?
No. Encoded entities display the same characters as the originals. Only the underlying HTML source changes.
Can it decode entities that are not in the common list?
Any numeric entity, decimal or hex, is decoded as long as it refers to a valid character. Named entities are decoded when they are in the tool's supported list. Unknown names are left unchanged.
Can I use this for URL encoding?
No. HTML entities and URL encoding are separate systems. Use a URL encoder for query strings, paths, and form values.