UtilHub

HTML Entities

Convert special characters like <, >, &, and quotes to their HTML entity equivalents and back. Supports named entities, numeric codes, and hex codes.

&lt;h1 class=&quot;title&quot;&gt;Hello &amp; &quot;World&quot;!&lt;/h1&gt;
&lt;p&gt;Price: €29.99 © 2026&lt;/p&gt;
Common HTML entities ▸

Frequently Asked Questions

When do I need to encode HTML entities?

Always encode user-provided content before inserting it into HTML to prevent XSS attacks. Characters like <, >, &, and " must be escaped. Use minimal encoding for HTML attributes and content, full encoding when extra safety is needed.

What is the difference between minimal and full encoding?

Minimal encodes the 5 critical characters (&, <, >, ", ') that can break HTML or enable XSS. Full additionally encodes all non-ASCII characters (like é, ©, →) as numeric entities, creating pure ASCII output safe for any HTML context.

What is a non-breaking space (&nbsp;)?

&nbsp; is an HTML entity for a space that won't be collapsed or line-broken. Use it to prevent line breaks between words (e.g., '10&nbsp;KB') or to add extra spacing in HTML where multiple spaces would be collapsed.