Skip to content
useToolz online tools

HTML Entities онлайн

Sign in or register to save tools to favorites

Encode HTML entities for safe text insertion into HTML documents.

Replaces special characters: < with &lt;, > with &gt;, & with &amp;, " with &quot;.

Prevents XSS attacks and incorrect display of HTML code on the page.

HTML Entities — Encoding and Decoding HTML Characters

HTML entities are special character sequences for displaying characters that have special meaning in HTML (<, >, &) or are absent from the keyboard. Encoding is essential for XSS prevention and correct content display.

Common HTML Entities

CharacterNamedDecimalHex
&&amp;&#38;&#x26;
<&lt;&#60;&#x3C;
>&gt;&#62;&#x3E;
"&quot;&#34;&#x22;
Non-breaking space&nbsp;&#160;&#xA0;
©&copy;&#169;&#xA9;

Named vs Numeric Entities

Named (&amp;) — readable, memorable. Decimal numeric (&#38;) — works for any Unicode character. Hex numeric (&#x26;) — same in hex notation. All three are equivalent.

XSS Prevention

XSS (Cross-Site Scripting) injects malicious JS through user input. HTML entity encoding prevents tags from being interpreted: <script>alert(1)</script> is displayed as text, not executed. Always encode user input before outputting to HTML.

Frequently Asked Questions

When should HTML entities be encoded?
Always when outputting user content in HTML, especially in tag attributes and script contexts.

Do non-ASCII characters need encoding?
In UTF-8 documents — no. Browsers display Unicode correctly without encoding.

What is the difference between &nbsp; and a regular space?
A non-breaking space prevents line breaks at that position and guarantees multiple consecutive spaces are displayed.

For URL encoding use URL Encoder, for Base64 — Base64 encoder.

We use cookies for site operation and analytics. Подробнее

Upscaled image
Download

Log in to continue

or