HTML entity encoder
Encode and decode HTML entities
Runs in your browser. Nothing is uploaded.
How it works
HTML entities let you show characters that would otherwise be read as code. For example, < is written < so the browser shows it as text and doesn’t treat it as a tag. Encode text to make it safe to display, or decode it to get the original back. We warn you about double encoding.
Special characters become &name; or &#number;.
Named entities such as © are easy to read. Numeric ones such as © work for any character.
Worked example. <b> becomes <b>, so a browser shows it as text instead of reading it as a tag.
Examples
| Character | Named | Numeric |
|---|---|---|
| < | < | < |
| & | & | & |
| " | " | " |
| © | © | © |
What this tool doesn’t cover
- Encoding text helps, but it isn’t a full defence against script injection. Use your framework’s escaping too.
Questions
Which characters must be encoded?
At least &, <, > and quotes inside attributes.
What is double encoding?
Encoding text twice, so & becomes &amp;. We warn you when it’s likely.
Is my data uploaded?
No. Everything runs in your browser.
What is an HTML entity?
A code that shows a character safely in HTML. For example, < shows a less-than sign without starting a tag.
How do I show code on a web page?
Encode the characters <, >, and &, then paste the result into your page. The browser shows the code and doesn’t run it.
Was this useful?
Built by QuickToolz.
Sources: WHATWG HTML: named character references (opens in a new tab)
Sponsored
Advertise here10 spots leftSponsored
Advertise here10 spots left