HTML entity encoder
Turn raw characters into safe HTML entities, or decode them back to text.
Your text is processed only in your browser. Nothing is uploaded.
How to use this tool
- Pick Encode to make text safe to drop into HTML, or Decode to read encoded markup.
- Paste your text and click Convert.
- Copy the result.
What HTML entities are
Some characters have special meaning in HTML. A less-than sign starts a tag and an ampersand starts an entity, so showing them as literal text means replacing them with named or numbered codes, for example < for a less-than sign. Encoding prevents your content from being read as markup, which also helps avoid display bugs and injection issues.
A real example
You want to publish a code snippet that includes HTML tags inside a blog post. If you paste it raw, the browser renders the tags instead of showing them. Encoding the snippet first makes the tags appear exactly as written, so readers see the code rather than its effect.
Common questions
Which characters get encoded?
The reserved ones: ampersand, less-than, greater-than, double quote, and single quote. Everything else is left readable.
Does decoding handle numeric entities?
Yes. Decoding uses the browser's own parser, so named and numeric entities both resolve correctly.