How to use the HTML Entity Encoder
- Choose Encode or Decode.
- Paste your text.
- Copy the result.
What does this tool do?
Characters like < and & must be escaped to appear as text in HTML; otherwise browsers treat them as markup. Escaping user input is also a basic defence against cross-site scripting (XSS).
Why use it?
- Show code samples on web pages.
- Decode entities in scraped or exported text.
- Encode non-ASCII characters for old systems.
Example
<a href="?a=1&b=2"> encodes to <a href="?a=1&b=2">
Privacy
Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.
Frequently asked questions
Which characters must be escaped in HTML?
The essential ones are & (&) and < (<). Inside attribute values, escape quotes as well ("). Most other characters, including accented letters and emoji, work fine as they are in a UTF-8 page.
What's the difference between and a normal space?
is a non-breaking space: it looks like a space, but the browser won't start a new line there. It's useful between a number and its unit, like “10 kg”.
Last reviewed by the M2Toolkit team.