Skip to content
WebTricks

HTML entity encoder / decoder

Escape text to HTML entities or decode entities back to characters. Named, decimal and hex entities supported.

Entities
<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 (&#65;) and hex (&#x41;) 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 &amp;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 &amp;copy; are human-readable aliases; numeric ones like &amp;#169; or &amp;#xa9; reference a character by its code point. The decoder understands all three forms.