HTML entity encoder / decoder
Escape text to HTML entities or decode entities back to characters. Named, decimal and hex entities supported.
<a href="x">Tom & Jerry’s</a>
About this HTML entity tool
Encode turns text into safe HTML by escaping the special characters
(& < > " ') so they render as literal symbols instead of being parsed as
markup. Decode reverses it, turning named, decimal (A) and hex
(A) entities back into characters.
When you need it
Escape any user-provided or dynamic string before dropping it into HTML to
prevent broken markup and a whole class of injection bugs. Decoding is handy
when you’re reading scraped or stored content where &lt; and friends have
crept in and you want the original text back.
FAQ
Which characters must be escaped in HTML?
The essentials are ampersand, less-than and greater-than. Inside attribute values you also escape double and single quotes. This tool handles all five.
What is the difference between named and numeric entities?
Named entities like &copy; are human-readable aliases; numeric ones like &#169; or &#xa9; reference a character by its code point. The decoder understands all three forms.