Developer Tools

HTML Encoder / Decoder

Encode special characters to HTML entities or decode entities back to readable text. Essential for safely embedding content in HTML.

Free · Runs in your browser · No signup · Files stay on your device

Share:
1 line • 44 chars

Paste HTML or HTML entities, keep line numbers visible, and run encode or decode without leaving fullscreen mode.

Quick examples

Choose Encode HTML or Decode HTML to transform the current text.
Encoded output
<div class="hero">Build faster & safer</div>

How to use

How to use HTML Encoder / Decoder

  1. 1Paste your text or HTML into the input box.
  2. 2Click 'Encode' to convert special characters to HTML entities, or 'Decode' to reverse.
  3. 3Copy the result from the output box.

Tips

Quick tips

  • Encoding prevents XSS by converting <, >, &, and quotes to HTML entities.
  • Use decode to convert &amp;lt; back to < when reading escaped HTML.
  • Useful when pasting code into HTML, CMS editors, or email templates.

FAQ

Frequently asked questions

What characters are encoded?

The encoder converts &, <, >, double quotes, and single quotes to their HTML entity equivalents (&amp;, &lt;, &gt;, &quot;, &#39;).

When should I encode HTML?

Whenever you display user-generated content in HTML to prevent XSS attacks, or when embedding code snippets in web pages.

Does the decoder handle numeric entities?

Yes. Both decimal (&#60;) and hexadecimal (&#x3C;) numeric entities are decoded.

Related

Related tools and guides