Turn < > & " ' into HTML entities, or decode entities like & back to text.
No sign-up, no fees.
HTML encode: turn < > & " ' characters into HTML codes.
HTML decode: make codes like &, ", é readable.
If you want, encode accented letters and emoji too.
Lists the codes it doesn't recognize.
What you type is processed, but never shared with anyone.
How to use the HTML Entity Encode / Decode Tool
Does the browser think you typed a tag when you write <div>? Four steps:
Pick the direction.Encode or Decode.
Paste the text. Paste it into the Text to encode or HTML to decode box. The result is prepared below as you type.
Pick the scope (when encoding). Under What to encode, Special characters only (<, >, &, ", ') or Everything non-ASCII (accents, emoji too).
Copy. Take the result with Copy.
What is an HTML entity?
An HTML entity is a way of writing a character that has a special meaning in HTML, or isn't on the keyboard, with a code that starts with & and ends with ;. The < sign means the start of a tag in HTML; if you want to show a plain "<" on the page, you write <. HTML escape and unescape are needed to show code examples on a web page, to safely put text from a user on a page, or to make text that arrives from a database like "Hello" & welcome readable.
Which characters get encoded, and why?
Character
Code
Why
<
<
Taken for the start of a tag
>
>
Taken for the end of a tag
&
&
The codes themselves start with &
"
"
Closes an attribute value too early
'
'
Closes single-quoted attributes
Encoding these five characters before putting text from a user on a page is the basic defense against script injection (XSS).
When sharing a code example: before putting an HTML example in a blog post, encode it with Special characters only; the reader sees the code, the browser doesn't run it.
Email templates: for old email programs, encoding accented letters too may be needed; then pick Everything non-ASCII.
Double encoding: if you see &amp;, the text has been encoded twice; decode twice.
When should I encode HTML?
When showing an HTML example in a forum or blog post.
When putting a name, comment or message from a user into a template.
When putting text with special characters into an XML or RSS file.
When you want to keep accented letters from breaking in an old email template.
Common mistakes
Confusing HTML encoding with URL encoding: addresses use percent-encoding like %20; for that there's URL encode / decode.
Thinking encoding is encryption: anyone can decode it.
The conversion happens in your browser. What you type is processed, but never shared with anyone.
Why does ` ` show up in my text?
It's a code for a non-breaking space. Decode it and it turns into a space that doesn't break onto the next line.
Is encoding the same as escaping?
In practice, yes. "HTML escape" and "HTML encode" mean the same thing: turning special characters into codes.
Which scope should I pick?
Special characters only is enough for most jobs. Pick Everything non-ASCII only if the system you'll paste into can't handle accented letters or emoji.
What does an unrecognized code mean?
A named code that isn't in the common list. The tool leaves it as it is; look it up in an HTML entity reference if you need it.
Does encoding protect against XSS?
Encoding the five special characters before putting user text on a page is the basic defense. Real applications should use their framework's built-in escaping rather than doing it by hand.
Can I use it on my phone?
Yes. Paste the text, pick the direction and tap Copy.
Can I decode € and the like?
Yes. Numeric codes in decimal or hexadecimal are decoded: € and € both become the euro sign.