Free Developer Tool

HTML Encoder & Decoder

Encode and decode HTML entities online. Convert special characters like <, >, & to their HTML entity equivalents or decode entities back to readable text. 100% client-side processing - your data never leaves your browser.

Input String
Result

Quick Usage Guide

Named vs Numeric Entities

By default, common characters use named entities like &lt;. Enable Numeric to use &#60; format instead.

Encode All Characters

Enable this to convert every character to its numeric entity, useful for obfuscating text or ensuring maximum compatibility.

HTML Encoding 101

What is HTML Encoding?

HTML encoding converts special characters into HTML entities so they display correctly in web pages without being interpreted as HTML markup. For example, < becomes &lt;.

XSS Prevention

Proper HTML encoding is essential for preventing Cross-Site Scripting (XSS) attacks. By encoding user input before displaying it, you prevent malicious scripts from being executed in browsers.

Named vs Numeric Entities

Named entities like &amp; are readable but limited to common characters. Numeric entities like &#38; can represent any Unicode character and are more universally supported.

Common Mistakes

Double-encoding (encoding already encoded text) can break your output. Always decode before re-encoding. Also, remember that encoding is context-dependent - HTML attributes may need different handling than HTML content.

Common HTML Entities

Character Named Entity Numeric Entity Description
< &lt; &#60; Less than (opens tags)
> &gt; &#62; Greater than (closes tags)
& &amp; &#38; Ampersand (starts entities)
" &quot; &#34; Double quote (attribute values)
' &apos; &#39; Single quote / apostrophe
  &nbsp; &#160; Non-breaking space
© &copy; &#169; Copyright symbol

Common Use Cases

Display Code Snippets

When showing HTML code examples on a webpage, encode the tags so they display as text instead of being rendered as actual HTML elements.

Sanitize User Input

Encode user-submitted content before displaying it to prevent XSS attacks and ensure malicious scripts cannot execute in visitors' browsers.

Email Templates

Encode special characters in HTML email templates to ensure consistent rendering across different email clients and platforms.

cta-image

Streamline Your Development Workflow

From code formatting to deployment pipelines — we build custom developer tools, CI/CD automation, and internal platforms that boost your team's productivity. Let us help you eliminate repetitive tasks and ship faster.

Optimize Your Workflow