Decode HTML entities back to readable text, or encode special characters into entities. Handles named and numeric entities in both directions.
How to use the HTML encoder and decoder
1
Paste your text
Enter text or HTML entities in the text area. Use Encode to represent special characters as entities, or Decode to turn entities back into characters.
2
Choose non-ASCII handling
Leave the checkbox off to preserve accented letters, Turkish letters, symbols and emoji. Enable it to encode characters above U+007E as decimal numeric entities, for example é becomes é.
Compare plain text with its encoded form, then use the entity reference to identify common characters. The café example uses the optional non-ASCII checkbox.
import html
html.escape("<a href=\"/pricing\">Tom & Jerry</a>") # '<a href="/pricing">Tom & Jerry</a>'
html.unescape("<p>café</p>") # '<p>café</p>'
Frequently asked questions
What does HTML encode do to special characters?
HTML encoding replaces special characters with entities so they can appear as text in HTML. This encoder changes & to &, < to <, > to >, " to ", and ' to '. These escapes suit HTML text and quoted attribute values; JavaScript inside a script block, URLs and CSS require different handling.
The sequence &amp; appears when & is encoded again, which is called double encoding. Rendered as HTML, it displays the literal text &. Decode removes one level per click: &lt; becomes <, and a second click produces <.
Do I need HTML entities for accented letters or emoji?
UTF-8 HTML documents do not need entities for accented letters, Turkish letters or emoji. The checkbox is off by default, so these characters stay unchanged. Enable it when needed for old encodings, email templates or systems that mishandle non-ASCII text: é becomes é, € becomes €, and 😀 becomes 😀.
Is HTML decrypt the same as decoding or sanitizing?
“HTML decrypt” usually means decoding entities; it is neither decryption nor sanitization. Entities are reversible text representations with no encryption key. This tool does not remove tags or strip scripts, and decoding untrusted HTML does not make it safe to insert into a page.
Is my text sent to a server?
No, all encoding and decoding happens in your browser, and your text is not sent anywhere. Decoding only reads the result as text; it does not execute scripts or load anything.
Related free tools
Use the encoding or format tool that matches your next step.
Every free tool here is a byproduct of the custom software, SaaS platforms and AI products we ship for our enterprise clients. Need a production-grade version, an API, or a full engineering team behind the next build? Let's talk.