Developer ToolsFree24.4k uses this week

HTML Entity Encoder

Encode and decode HTML entities like &, <, > and more.

How it works

Paste HTML content to encode special characters into HTML entities (< becomes &lt;, > becomes &gt;, & becomes &amp;). Or paste encoded HTML to decode it back to readable characters. Handles the full HTML5 entity set.

Why use this tool?

Required when embedding user-generated content in HTML to prevent XSS (cross-site scripting) attacks. Also used when displaying raw HTML code in blog posts and documentation without the browser rendering it.

Frequently Asked Questions

What is the most important HTML entity to know?
The five critical entities are: &lt; (<), &gt; (>), &amp; (&), &quot; ("), and &apos; ('). These five characters have special meaning in HTML and must always be encoded in user-generated content to prevent XSS.
When should I encode HTML entities?
Always encode user-provided content before rendering it in HTML. This prevents XSS (cross-site scripting) attacks where malicious users inject HTML or JavaScript into your page.
What is &nbsp;?
&nbsp; is a non-breaking space — it looks like a space but prevents line breaks at that point. Commonly used in menus, currency values (€ 100), and table cells where you don't want text to wrap.
Is this free?
Yes, completely free. Encode and decode HTML entities instantly in your browser.
Rate this tool:

Was this tool helpful?

Back to all tools

More Developer Tools Tools