HTML Encoder/Decoder

Encode and decode HTML entities instantly with our free online tool

HTML encoded/decoded result will appear here

How to use this HTML Encoder/Decoder:

  1. Select mode - Encode (text to HTML entities) or Decode (HTML entities to text)
  2. Choose the encoding type (HTML, hexadecimal, or decimal entities)
  3. Enter your text in the left input box
  4. Click Convert to transform your data
  5. View the result in the right panel
  6. Click Copy to copy the result to clipboard
  7. Click Swap to quickly switch between input and output
  8. Click Clear All to reset both input and output
  9. For quick conversion, use the keyboard shortcut Ctrl+Enter (Windows) or Cmd+Enter (Mac)

About HTML Encoding:

  • HTML encoding converts special characters to entities that can be safely displayed in HTML
  • Essential for preventing XSS (Cross-Site Scripting) attacks when displaying user-generated content
  • Three encoding types:
    • HTML Entities: &name; format (e.g., &lt; for <)
    • Hexadecimal Entities: &#xHH; format (e.g., &#x3C; for <)
    • Decimal Entities: &#DDD; format (e.g., &#60; for <)
  • Common encoded characters:
    • < becomes &lt; or &#60; or &#x3C;
    • > becomes &gt; or &#62; or &#x3E;
    • & becomes &amp; or &#38; or &#x26;
    • " becomes &quot; or &#34; or &#x22;
  • Always encode user input before displaying it in HTML to prevent injection attacks

Your data is processed in your browser only - we never store or send your input/output to any server