HTML Entity Encode / Decode
Encode and decode HTML entities and special characters safely.
Output will appear hereProcessed in your browser — nothing is sent.
About this tool
HTML Entity Encode/Decode is a free tool for handling the special characters that carry meaning in HTML. Characters like <, >, &, and quotation marks are treated by the browser as part of the markup when dropped straight into a page, so < is read as the start of a tag. To escape html is to rewrite these characters as codes, so < becomes < and & becomes &, making them display as the literal characters you intended.
The tool works both ways:
- Encode — turns text or code into HTML entities that are safe to embed in a page.
- Decode — converts entities back into the original readable characters.
There are several reasons to reach for it. First, when you want to display sample code on a page, such as a tutorial about writing HTML, you must escape it first or the browser will run the real tags. Second, security: when rendering text that users have entered, escaping reduces the risk of malicious script injection (XSS). Third, it ensures special symbols and non-Latin characters display fully and correctly.
On privacy, everything is processed in your browser, with no data sent to a server. It is free, needs no signup, and requires nothing to install. Open it on any device and start right away.
How to use
- 1Paste the text or HTML code you want into the input box
- 2Click Encode to turn special characters into HTML entities, or Decode to convert them back
- 3See the result in the other panel and copy it for use
Frequently asked questions
- What is an HTML entity?
- It is a code that stands in for a character with special meaning in HTML. For example, a less-than sign is written as < and an ampersand as &, so they display as text rather than being treated as markup.
- Why do I need to encode HTML entities?
- It lets special characters like < > and & display correctly on a page without breaking the structure, and it reduces the risk of script injection (XSS) when showing text that users have entered.
- Can I use it to display sample code on a web page?
- Yes, that is a great use. To show HTML code as text for readers, you must escape the special characters first, or the browser will render them as real tags.
- Is my data sent to a server?
- No. Everything runs in your browser and nothing is sent anywhere.
- Is it free to use?
- Yes, it is free with no signup and no usage limits.