HTML Entity Encoder
Escape special characters for HTML, or decode entities.
- 100% Free
- No Sign Up
- Works in Your Browser
HTML entity encoder
Escape and unescape HTML entities
More Developer Tools
View all tools- Base64 encode/decodeEncode and decode Base64 text
- Image to Base64Turn an image into a data URI
- URL encode/decodePercent-encode and decode URLs
- JWT decoderDecode a JSON Web Token
- JSON escape/unescapeEscape text for a JSON string
- JSON formatterPretty-print and indent JSON
- UUID generatorGenerate random v4 or time-ordered v7 UUIDs
- Timestamp converterConvert Unix epoch time to dates
- Regex testerTest regular expressions live
Every everyday developer tool, right in your browser.
No installs. No uploads. No signup.
Browse all 36 tools- Developer tools
- 36
- Cheat sheets
- 10
- Bytes uploaded
- 0
How to use the HTML entity encoder
Three steps, all in your browser.
- 1
Paste your input
Type or paste your code or data. Press Sample to try an example.
- 2
Choose the direction
Encode or decode. Errors point at what's wrong with the input.
- 3
Copy the result
Copy the output in one click. Nothing is saved or sent anywhere.
HTML Entity Encoder: what to know
The HTML entity encoder escapes text so it displays as text in HTML instead of being read as markup: < becomes <, > becomes >, & becomes & and quotes become " and '. The decoder does the reverse, turning named entities (©, ), decimal (©) and hexadecimal (©) references back into characters.
Escaping is how you show code samples on a web page and how templates keep user input from turning into tags. It's an important defense against cross-site scripting (XSS) when text is placed between tags or inside a quoted attribute. It isn't enough in other contexts, such as inside a script, a style or a URL attribute like href, which need their own escaping or validation.
In a page saved as UTF-8, which is nearly all of them, you don't need entities for accented letters, symbols or emoji: they can be written directly. Entities remain useful for invisible or ambiguous characters such as (a non-breaking space) and ­ (a soft hyphen).
Popular uses
- Showing HTML or XML code samples on a web page
- Decoding entities in scraped or exported content
- Escaping text for HTML attributes and templates
- Cleaning &amp; double-encoding bugs
Tips for the best result
- &amp; in your output means text was escaped twice; decode once and check where the first escape happens.
- Let your template engine or framework escape by default rather than escaping by hand.
- The HTML entities reference page lists common named entities with their codes.
Read how JustYourDev works and our privacy details. Code, data and files you use here are processed in your browser and are never sent to our server.