HTML encoder
Processed in your browser · nothing is uploaded
Escapes the five characters that must be escaped in HTML; `&`, `<`, `>`, `"` and `'`, and decodes named, decimal and hexadecimal entities back again.
How to use the html encoder
Order is the classic bug. Escape < to < first and then escape ampersands, and you have &lt;, which the page displays as literal text. Encoding here is a single pass over all five characters, so it cannot happen inside the tool, but it happens constantly in pipelines, where a template escapes a value some framework had already escaped. If you are seeing &lt;, find the second escape rather than decoding twice for ever.
The quote is written ' rather than ' on purpose. ' is defined in XML and in HTML5 but was never part of HTML 4.01, so the numeric form is the one every parser understands. Quotes only strictly need escaping inside an attribute value; escaping them in text content is harmless and simpler than deciding each time.
Escaping everything above ASCII as numeric entities is a separate option and mostly historical. It was necessary when pages were served as Latin-1; with UTF-8 it only makes the file larger and harder to read.
Two limits worth stating. Escaping is not sanitising: it makes text display safely, and it does not make user-supplied markup safe to insert, which needs an allowlist-based sanitiser. And the decoder handles numeric entities in full, decimal and hexadecimal, plus the common named ones: a rarer named entity is left exactly as it is rather than guessed at.
Questions
Ampersand, less-than and greater-than always; double and single quotes inside attribute values.
Something escaped it twice, in two separate passes. Find the second escape; decoding repeatedly only treats the symptom.
' is fine in XML and HTML5 but was not defined in HTML 4.01. The numeric form is understood everywhere.
Not with UTF-8. Numeric entities for non-ASCII are a Latin-1 era workaround that only adds bytes now.
Every numeric one, decimal and hexadecimal, plus the common named ones. Anything rarer is left untouched rather than guessed at.
It makes text display safely. It does not sanitise user-supplied markup, which needs an allowlist sanitiser.
No.