Text Tools
HTML Entity Encoder & Decoder
Escape < > & and quotes into HTML entities so they display as text, or unescape entities back to characters.
About the HTML Entity Encoder & Decoder
In HTML, a few characters have special meaning: "<" starts a tag and "&" starts an entity. To show them as normal text on a web page, they have to be written as HTML entities. This tool escapes text into entities and decodes any entity, named or numeric, back into characters, as you type.
What you can do with the HTML Entity Encoder & Decoder
- Escape and unescape: Turn < > & " into entities and back, as you type.
- Named and numeric: Decodes &, © and ❤ alike.
- Safe to paste: Show code on a web page without it running.
- Copy either side: Grab the encoded or decoded text.
The five characters that get encoded
& becomes &, < becomes <, > becomes >, the double quote becomes " and the single quote becomes '. The ampersand is handled first, so the entities themselves aren't encoded twice.
When you need it
Use it when showing code examples on a web page or in a blog post, or when placing text inside an HTML attribute. Escaping is also part of how websites prevent HTML injection, although real applications should rely on their framework's built-in escaping.
What decoding covers
Every named entity browsers understand, from & and to ©, → and …, plus numeric ones like ₹ and ₹. The counter shows how many entities were found.
Related tools
Frequently Asked Questions
Why does my text show "&amp;"?
It was encoded twice. Decode it once and it will return to a single encoded ampersand; decode again to get the plain character.
Do accented letters need to be encoded?
Not on a modern page saved as UTF-8. If you're pasting into an old system that only accepts ASCII, switch on "Also encode non-ASCII".
Which characters need to be escaped in HTML?
Five characters can be read as code: & becomes &, < becomes <, > becomes >, the double quote becomes " and the single quote becomes '. Encode mode replaces all five and shows how many it escaped.
Why does code I paste into my blog post disappear?
The browser treats anything inside < and > as a real HTML tag, so it runs or hides it instead of showing it. Encode the code first and paste the result, and readers will see the tags as text.
What's the difference between named and numeric entities?
A named entity uses a word, like ©, while a numeric one uses the character's Unicode number in decimal (©) or hex (©). All three show ©. Decode mode understands both kinds, but not every character has a name.
What is the HTML code for the rupee symbol ₹?
The rupee sign is Unicode U+20B9, so it is written ₹ in decimal or ₹ in hex. Most modern pages can include ₹ directly in UTF-8, but switch on "Also encode non-ASCII" if you need the numeric form.
What is and what does it decode to?
is a non-breaking space, character 160, also written  . It looks like a normal space but stops a line from breaking there, which keeps things like "₹ 500" together. Decoding turns it into that special space, not an ordinary one.
How do I keep line breaks when showing text on a web page?
HTML ignores ordinary line breaks, so separate lines run together. In Encode mode, switch on "Keep line breaks as <br>" and a <br> tag is added at the end of each line, so the text keeps its layout.
Does escaping HTML protect a site from script injection?
Escaping user text before adding it to a page is a key defence against cross-site scripting, because a <script> tag becomes harmless <script>. Text placed inside JavaScript or link addresses needs its own escaping, so this is not the only step.
How is an emoji written as an HTML entity?
Use its Unicode code point in decimal or hex. The waving hand 👋 is U+1F44B, so it becomes 👋 or 👋. With "Also encode non-ASCII" on, each emoji becomes one numeric entity like this.
Why does it use ' instead of ' for apostrophes?
' was not part of HTML 4, so older browsers and some email programs do not recognise it. ' works everywhere and shows the same apostrophe. Decode mode reads both forms.
Related tools
- Case Converter, Convert text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, PascalCase, snake_case or kebab-case.
- Text Cleaner, Clean messy pasted text with switchable rules: trim spaces, remove blank or duplicate lines, strip HTML, bullets and emojis, straighten quotes or join lines.
- Sort Lines, Sort a list alphabetically A→Z or Z→A, or numerically from smallest to largest, ignoring upper/lower case.
- Morse Code Translator, Translate text to International Morse code and decode dots and dashes back into letters.
- Binary Translator, Convert text to binary, hex, decimal or octal bytes (UTF-8) and back again, type in either box.
- Base64 Encoder & Decoder, Encode text to Base64 or decode Base64 strings back to text, with full UTF-8 and emoji support.