HTML Entity Encoder / Decoder

Escape or unescape HTML entities instantly as you type.

100% in your browser — nothing uploaded

Escape HTML special characters online

About this HTML entity encoder

In encode mode, every character that can break HTML — the ampersand, angle brackets, and quotes — becomes a safe entity like & or <. An optional mode also converts all non-ASCII text: accented letters become named entities such as ñ and é, and anything without a common name gets a hex code like 😀. Decode mode reverses the process and understands named, decimal, and hex entities alike, leaving anything that isn’t a valid entity exactly as you pasted it.

It’s a daily helper for developers escaping user content before rendering it, writers pasting text into CMS fields or HTML email templates where accents get mangled, and anyone cleaning up scraped pages full of ' and & codes. Everything runs locally in your browser with JavaScript — the text you paste is never uploaded, logged, or stored anywhere.

FAQ

Which characters do I always need to escape in HTML?

Five: the ampersand (&), the angle brackets (< and >), the double quote ("), and the single quote ('). The first three stop text from being read as markup; the quotes matter inside attribute values. The default mode covers exactly these.

What’s the difference between ñ, ñ, and ñ?

They all produce the same character: ñ. The first is a named entity, the second is decimal, and the third is hexadecimal. Browsers accept all three. This tool encodes to a named entity when a common name exists, hex otherwise, and decodes any of the three notations.

Is it safe to decode HTML that contains script tags?

Yes. Decoding converts entity codes into plain text characters — the result only ever lands in a text box and is never rendered or executed as HTML. And since everything runs in your browser, the content is never uploaded either.

Related tools