Escape text for HTML, or decode named, decimal and hexadecimal entity references back to characters. Parsed rather than rendered, so nothing can execute.
Waiting for text
The five characters that change how markup parses are always escaped.
Encoded text appears here
The result is always shown as plain characters — it is never rendered as markup.
HTML Entity Encoder runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
Five characters decide how a browser reads markup. An ampersand starts a character reference, a less-than sign starts a tag, a greater-than sign ends one, and quotation marks end an attribute value. Any of those appearing in text that will be placed into HTML has to be written as a reference — & for an ampersand, < for less-than — or the browser stops reading text and starts reading structure. That is not a formatting nicety: it is the mechanism behind cross-site scripting.
Encoding is offered at three scopes. Minimal escapes only those five characters, which is correct for almost every case and keeps the output readable. Named escapes non-ASCII characters using their standard names where one exists, which is what you want for an email template or a document that may be served with an uncertain character encoding. Numeric escapes everything non-ASCII as decimal or hexadecimal references, which is the most portable and the least readable.
Decoding runs a real parser over the input. It is worth being explicit about why: the obvious way to decode entities in a browser is to assign the text to an element's innerHTML and read back the text, and that approach executes whatever markup it was handed. A tool built that way will run an injected script the moment someone pastes one in. This one never touches the DOM — the input is parsed character by character, and the result is displayed as text in a preformatted block. Nothing you paste here can run.
The parser is also careful about what it leaves alone. A reference without its closing semicolon, a name that is not in the table, a numeric reference pointing outside the valid range, or a surrogate code point are all left exactly as they were and reported, rather than being guessed at or silently dropped. Round-tripping is honest: encode then decode returns what you started with.
If you are writing application code, use your framework's escaping rather than pasting text through a tool. React, Vue, Svelte and every modern template engine escape interpolated values by default, and the only time this is the right instrument is when you are inspecting or fixing content by hand.
Ampersand, less-than and greater-than in text content, plus both quotation marks inside attribute values. The ampersand is the one people forget, and it has to come first — escaping it after the others would double-escape them.
Yes. The decoder is a parser, not the DOM: your input is read character by character and the result is displayed as text in a preformatted block. At no point is anything assigned to innerHTML, so nothing you paste can execute.
A named reference like &eacute; is readable but relies on a defined name; a numeric reference like &#233; or &#xE9; works for any character at all. Numeric is more portable, named is easier for a person to read. Both decode to the same character.
Only for the structural characters. With a UTF-8 charset declared you can write é, — and emoji directly and they will render correctly. Escaping non-ASCII characters is for email templates, XML pipelines and anywhere the encoding cannot be relied upon.
It is left exactly as written and listed in the status line. Names missing their semicolon, names that are not in the table, and numeric references outside the valid range are reported rather than guessed at or quietly discarded.
No. Escaping at the point of output is what prevents injection, and that belongs in your template engine or framework, which does it automatically for interpolated values. This tool is for inspecting and fixing content by hand.
It is not — it decoded to a non-breaking space, which looks exactly like an ordinary space but is a different character. That is often the bug people are chasing, and the whitespace cleaner can strip them if you want ordinary spaces instead.