HTML Entity Encoder replaces the characters that have special meaning in HTML with their entity codes, so the less-than sign becomes <, the ampersand becomes & and quotes become ". Decode mode turns entities back into characters.
Encoding is what stops text from being interpreted as markup. Use it when you want to show code on a web page, or when inserting user-supplied text into HTML. A reference list of common entities sits below the tool for quick lookup.
Advertisement
How to use HTML Entity Encoder
1
Choose Encode or Decode
Select the mode.
2
Enter the text
The converted version appears below.
3
Copy
Paste it into your HTML.
Use Cases
- Displaying a code sample in a blog post
- Preparing text for an HTML email template
- Decoding entities in scraped content
Frequently Asked Questions
The less-than sign and ampersand in text, plus quotation marks inside attribute values.
Encoding output for the context it is placed in is the main defence, but it must be done for every untrusted value, and attributes, URLs and scripts each need their own handling.
No, not on a page served as UTF-8.
Yes, HTML Entity Encoder is 100% free with no usage limits, no watermarks, and no hidden charges. The platform is supported by non-intrusive advertising so all tools stay free for everyone.
Yes. HTML Entity Encoder runs entirely in your browser using client-side JavaScript. Your files and data never leave your device and are never transmitted to our servers.