DevToolbox

HTML Entity Encoder / Decoder

Convert special characters to HTML entities and back. Prevent XSS and display issues.

Common HTML entities

CharacterEntityDescription
&&Ampersand
<&lt;Less-than
>&gt;Greater-than
"&quot;Double quote
'&#39;Single quote
 &nbsp;Non-breaking space
©&copy;Copyright
®&reg;Registered trademark
&trade;Trademark

Common use cases

HTML encoding is a fundamental security and compatibility technique for web development.

Prevent XSS vulnerabilities

Encode user input before rendering it in HTML templates to neutralize script injection attempts.

Fix display issues

Encode special characters that break HTML rendering, such as angle brackets in code examples or ampersands in URLs.

Prepare email templates

Encode special characters in HTML email content to ensure consistent rendering across email clients.

Frequently asked questions

Short answers to the questions people usually have before using the tool.

When should I HTML-encode text?+

Encode user-supplied text before inserting it into HTML to prevent XSS attacks and ensure special characters like < > & display correctly instead of being interpreted as markup.

What is the difference between named and numeric entities?+

Named entities like &amp; are human-readable aliases. Numeric entities like &#38; use the Unicode code point. Both render the same character in browsers.

Does this tool handle emoji and Unicode?+

Yes. When the Encode all non-ASCII option is checked, emoji and other Unicode characters are converted to numeric HTML entities.

Related tools

Keep moving through related utility tasks without leaving the toolbox.