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.
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>
Usage notes
- Encoding prevents XSS by converting <, >, &, and quotes to HTML entities.
- Use decode to convert &lt; back to < when reading escaped HTML.
- Useful when pasting code into HTML, CMS editors, or email templates.
Related pages
How to Use This Tool
- 1Paste your text or HTML into the input box.
- 2Click 'Encode' to convert special characters to HTML entities, or 'Decode' to reverse.
- 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 (&, <, >, ", ').
- 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 (<) and hexadecimal (<) numeric entities are decoded.