HTML Entity Encoder & Decoder
Encode text to HTML entities or decode entities back to text. Escapes <, >, &, quotes and non-ASCII — runs entirely in your browser.
- ✓ Runs in your browser — nothing uploaded
- ✓ No sign-up
- ✓ Free, no limits
<a href="page.html">Tom & Jerry</a>
This free HTML entity tool encodes text into safe HTML entities and decodes entities back into plain text, in both directions. Encoding escapes the characters that would otherwise be interpreted as markup — <, >, &, single and double quotes — plus any non-ASCII character as a numeric entity, so your content displays literally instead of breaking the page or opening an injection hole. Decoding reverses named, decimal and hexadecimal entities back to the original characters.
It is the quick fix for the everyday problems of putting text into HTML: showing example code on a page without the browser rendering it, pasting content that arrived full of & and ', or preparing a string so that user input can't smuggle in a tag. Encoding the five HTML-special characters is the baseline defense against the most common cross-site-scripting mistakes.
Everything runs locally in your browser — nothing is uploaded. Worked example: encoding <a href="x">Tom & Jerry</a> produces <a href="x">Tom & Jerry</a>, and decoding it returns the original exactly. Unknown entities like ¬real; are left untouched rather than mangled.
Frequently asked questions
Which characters get encoded?
The five HTML-special characters (& < > " ') are always escaped, and every non-ASCII character is turned into a numeric entity so it survives any encoding. Decoding understands named, decimal and hex entities.
Does encoding HTML entities prevent XSS?
Escaping the HTML-special characters is the core defense for displaying untrusted text as content, so it removes the most common injection vector. It is one layer, not a complete security review, but it is the right first step.
Is my text sent anywhere?
No. Encoding and decoding happen entirely in your browser; nothing is transmitted or stored.