HTML Encode & Decode
Paste markup or entity-escaped text into Input, then Encode to turn & < > and quotes into safe entities, or Decode to restore the original characters. The result appears below the buttons.
Updated 2026-08-03 · developer
About this tool
Encode replaces ampersands, angle brackets, and double quotes with & < > and ". Decode reverses those four entities in a safe order so nested ampersands do not break. Both actions run on the textarea text and write into the result area—no file upload.
How to use
- Paste into Input: Put the HTML fragment or entity string into the Input textarea.
- Encode special characters: Click Encode to convert &, <, >, and " into HTML entities in the result.
- Decode entities: Click Decode to turn < > " and & back into live characters.
- Copy the result: Select the text in the result area and paste it into your editor or template.
Common use cases
- Escape a snippet before dropping it into an attribute or CMS field that treats raw tags as HTML.
- Recover readable markup from a log or email that stored entities instead of brackets.
- Teach how & and < become entities when you need a quick before-and-after demo.
Tips
- Run Encode on raw HTML; run Decode only when the box already contains entity sequences.
- Decode applies & last so sequences like &lt; resolve correctly in one pass.
FAQ
Which characters does Encode change?
It escapes ampersand, less-than, greater-than, and double quote. Other characters stay as typed.
Why decode & after the other entities?
Decoding & last prevents turning &lt; into a broken intermediate string before < is handled.
Does this tool send my HTML to a server?
No. Encode and Decode transform the Input value in the page.
Can I encode an empty Input?
Yes. An empty string encodes and decodes to an empty result.