HTML entities are escape sequences that let you include reserved or non-ASCII characters in HTML without breaking the markup. For example, < renders as a literal less-than sign instead of starting a tag. This free tool converts text to entities and back, helping you debug templates, sanitise attribute values, or prepare characters for an HTML email.
How it works
When encoding, the tool walks your text one character at a time. The five characters that have special meaning in HTML — &, <, >, " and ' — are replaced with their named entities. A handful of common symbols (such as the copyright, trademark, and currency signs) also get readable named entities. If you enable the non-ASCII option, every remaining character above code point 127 becomes a numeric reference &#NNN; based on its Unicode code point, producing pure-ASCII output.
When decoding, the tool matches each &...; sequence and resolves named entities from its table, decimal references like €, and hexadecimal references like €, restoring the original characters.
Example and tips
Encoding <a href="x">café & co</a> produces <a href="x">café & co</a>. Always encode user-supplied text before placing it inside HTML to prevent broken layouts and cross-site scripting. Inside attribute values, encoding the quote characters is essential so they do not prematurely close the attribute.