Skip to content

HTML Entity Encoder / Decoder

Encode special characters to HTML entities, or decode them back.

Last updated August 26, 2026

Encoding

About this tool

Characters like <, >, and & have special meaning in HTML, so displaying them literally on a web page (e.g. showing example code, or a user's name containing an ampersand) requires converting them to HTML entities like &lt; and &amp;. This tool encodes reserved and non-ASCII characters into their entity form, or decodes entities back to plain text.

Common HTML entities

CharacterEntity
&&amp;
<&lt;
>&gt;
"&quot;
'&#39;
non-breaking space&nbsp;

Frequently asked questions

Why does unescaped user input in HTML matter for security?

Rendering user-supplied text directly into HTML without encoding characters like < and > can allow cross-site scripting (XSS) attacks, where an attacker injects executable script tags into your page.

What's the difference between named and numeric entities?

Named entities like &amp; are easier to read but only cover a limited set of characters. Numeric entities like &#233; (for é) can represent any Unicode character and are what this tool uses for anything outside the small named set.