Built and fact-checked by the DocNectar team — see our editorial standards
Key Features
Instant Calculation
Get accurate results in real time with our optimized algorithm.
Mobile Friendly
Fully responsive design. Works on all devices & screen sizes.
Privacy Focused
Your data stays on your device. We don't store any inputs.
100% Free
No hidden costs. This tool is completely free forever.
Characters like the less-than sign, greater-than sign, ampersand, and quotes have special meaning in HTML, so text containing them needs to be encoded before being embedded safely in a page. Going the other direction, encoded entities from scraped or copied HTML often need decoding back to plain readable text.
This tool handles both directions: encoding plain text into safe HTML entities, or decoding HTML entities back into their original characters.
How it works
Paste your text and choose encode or decode. Encoding converts special characters (the less-than sign, greater-than sign, ampersand, and quotes) into their HTML entity equivalents; decoding reverses the process, converting entities back into plain characters.
- Enter text.
- Enter mode.
- Click Calculate to see your results.
Examples
Encoding a snippet for safe display
A line of markup like a "div" tag wrapping the text "Tom & Jerry" gets each special character swapped for its named entity — the ampersand becomes an "amp" entity, the tag's angle brackets become "lt"/"gt" entities, and the quotes around the class name become "quot" entities — so the browser displays the code as plain visible text instead of running it as markup.
Decoding scraped text
Entity-encoded text copied from an RSS feed or scraped page (with named entities standing in for ampersands, quotes, and angle brackets) decodes back into the original readable sentence, symbols and all.
Who should use it
- Safely displaying code snippets or markup examples as literal text on a page.
- Decoding entity-encoded text copied from scraped HTML or an RSS feed.
Industry applications
- Web development
- Content management and publishing
Advantages
- Handles both encoding and decoding in one tool.
- Covers the standard HTML5 entity set and UTF-8 text correctly.
Limitations
- Not a substitute for a full HTML sanitizer when handling untrusted rich content that needs some tags allowed.
Common mistakes to avoid
- Double-encoding text that's already been through an entity encoder, which turns an already-encoded ampersand entity into a garbled double-encoded one.
- Assuming encoding alone is a substitute for a proper HTML sanitizer when accepting untrusted rich content.
- Encoding text that's about to be inserted via a templating engine that already auto-escapes output — resulting in visibly-broken double-encoded entities on the page.
Best practices
- Encode text once, right before display — encoding data at multiple points in a pipeline is a common source of double-encoding bugs.
Tips
- If your text is going through multiple systems before display, encode it once as close to the final display step as possible to avoid double-encoding.