HTML Entity Encoder and Decoder

Encode special characters as HTML entities, or decode entities back to readable text.

How to use

What it checks and how it works

Encoding replaces the five characters HTML reserves (the ampersand, the two angle brackets and the two quote marks) with entities, so text can be shown on a page without being read as markup. The named style also writes characters such as é as a named reference where the HTML Living Standard defines a name, and the numeric style writes every non-ASCII character as a hexadecimal reference. Decoding follows the HTML Living Standard's list of named character references and also reads decimal and hexadecimal numbers. Encoding is not a full defense against injection: where text lands in a script, a URL or an attribute, each place has its own escaping rules. If decoded text still contains entities, the tool tells you it was probably encoded twice.

Do I need to encode Arabic text?

No. In a UTF-8 page, Arabic letters can be written as they are. Encode only the reserved characters, unless your system cannot handle UTF-8.

What is the difference between named and numeric entities?

A named entity, such as the one for the copyright sign, is readable but exists only for some characters. A numeric entity works for any character.

Why is there still an ampersand code in my decoded text?

The text was probably encoded twice, so one round of decoding leaves entities behind. Decode it again until none remain.

Sources

Related tools

Privacy

Runs in your browser; nothing is uploaded. The interactive tool needs JavaScript.