Developer tool

HTML Entity Encoder / Decoder

Escape or unescape HTML entities like &.

Free Runs in your browser

Common entities

CharacterNamedNumericDescription

About this tool

HTML Entity Encoder escapes characters such as <, > and & so they show as text in a web page instead of being read as markup. The decoder turns entities back into plain characters.

How to use HTML Entity Encoder / Decoder

  1. Paste your text or HTML.
  2. Pick an encoding mode.
  3. Press “Encode” or “Decode” and copy the result.

Questions people ask

Which characters must be escaped in HTML?

In text, & and < must be escaped. Inside attribute values, also escape the quote character you use. Escaping > is optional but common.

Named or numeric entities?

Both work in all browsers. Named entities like &copy; are easier to read, while numeric ones like &#169; work for every Unicode character.

Does encoding protect against XSS?

Escaping text before inserting it into HTML is one part of XSS protection, but attributes, URLs and scripts need their own escaping rules.

More developer tools

See all 24 →
Esc