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.

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

Encoded output
<div class="hero">Build faster & safer</div>

Usage notes

  • 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.

How to Use This Tool

  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.

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.