● online

HTML Encoder and Decoder

Escape HTML special characters so markup displays as text instead of rendering, or decode entities back into plain characters.

How to use the HTML Encoder and Decoder

  1. Paste your HTML or entity-encoded text.
  2. Choose encode or decode.
  3. Copy the result.

About the HTML Encoder and Decoder

Escaping user input before it is inserted into a page is the basic defence against cross-site scripting: converting angle brackets and ampersands into entities means a submitted <script> tag displays as text rather than executing. It is also what you need when writing a tutorial that shows code examples on a page. Decoding goes the other way, turning entity-laden output back into something readable.

Frequently asked questions

Which characters need HTML encoding?

Primarily < > & " and ', because they have structural meaning in HTML and attributes.

Does encoding prevent XSS?

Escaping output correctly for its context is a key defence, but it is not a complete solution on its own — validate input and set a content security policy too.

Why do I see &amp;amp; in my page?

Double encoding — the text was escaped twice. Decode it once here to fix it.

Related free tools

← Back to all 106 free online tools

Runs entirely in your browser — nothing you enter is uploaded. Last reviewed and updated .

The Tools Guru Editorial Team

Three front-end engineers and technical writers in Punjab, Pakistan, shipping browser software since 2011. Every formula on this site is implemented from a primary source and checked against an independent reference implementation before release — see our editorial policy. Spotted a wrong number? Tell us and we will reproduce it, usually the same working day.

Explore all 106 free tools

Results filter as you type. Press Control plus K to jump here. Ctrl K
106tools0uploads to servers100%free forever

Trending now

All tools