HTML Entity Encoder & Decoder

Escape HTML special characters into entities, or decode entities back into readable text. Handles named and numeric entities.

About HTML Entities

What are HTML entities?

HTML entities are text codes that represent characters which would otherwise be interpreted as markup. For example &lt; renders as a literal < character, and &amp; renders as &.

When do I need to encode HTML?

Whenever user-supplied text is inserted into HTML — comments, form output, templates, CMS fields — the characters &, <, >, " and ' must be escaped, otherwise they can break the page or open an XSS hole.

Does it decode numeric entities too?

Yes. Both decimal (&#38;) and hexadecimal (&#x26;) entities are decoded, as well as the full set of named entities such as &nbsp;, &copy; or &hellip;.

What does "Encode non-ASCII" do?

It converts every character outside the ASCII range into a numeric entity, so text with accents, emoji or CJK characters survives any transport that only supports 7-bit ASCII.

Is my text sent anywhere?

No. Encoding and decoding happen entirely in your browser with JavaScript. Nothing is uploaded.