HTML Encoder/Decoder (Free, Instant)

Encode or decode HTML entities in one tool.

🛡️ Warning: Always encode user input before displaying it in HTML to prevent XSS (Cross-Site Scripting) attacks.
0 / 2,000 characters
Free tier: 2,000 characters.
đź’ˇ Common Uses:
  • Encode: Sanitize user input, prevent XSS attacks
  • Decode: Convert HTML entities back to readable text
Example: "<div>" ↔ "&lt;div&gt;"

Why Use HTML Encoding/Decoding?

HTML encoding converts special characters (<, >, &, ", ') into entities (&lt;, &gt;, &amp;, &quot;, &#39;) to prevent XSS attacks and display code safely. Decoding reverses this for readability. A combined tool lets you encode user input for security, then decode API responses—all in one place.

Common Use Cases

  • XSS prevention: Encode user input before displaying in HTML to block script injection
  • Code examples: Encode HTML/XML snippets for display on documentation pages
  • API integration: Encode HTML strings in JSON requests, decode responses
  • Content scraping: Decode HTML entities from scraped content to get readable text
  • CMS development: Encode/decode content in WordPress, Drupal, or custom CMSes
  • Email templates: Encode special characters in HTML emails for compatibility

Why This Tool?

  • Bidirectional: Encode and decode in one tool—no page switching
  • Security-focused: Encode all dangerous HTML characters to prevent XSS
  • Complete entity support: Decodes all HTML entities (numeric & named)
  • 100% client-side: Your HTML never touches our servers
  • Free forever: Unlimited encoding/decoding with no rate limits

Pro tip: For stripping HTML tags completely, use HTML to Plain Text. For encoding URLs, try URL Encoder.