HTML Entity Encoder & Decoder

Escape special characters to HTML entities and decode entities back to text. Named, decimal or hex entities, with options for non-ASCII characters.

Runs 100% in your browser. Nothing you paste is uploaded.

Text

—

HTML entities

—

About the HTML Entity Encoder

Characters like <, > and & have special meaning in HTML. To display them literally — for example code samples in a blog post — they must be escaped as entities. Escaping user input is also the first line of defence against cross-site scripting (XSS).

Features

  • Escape only the five HTML-special characters, or all non-ASCII
  • Named (&copy;), decimal or hex entities
  • Decodes all 2,000+ named HTML5 entities
  • Unicode and emoji safe

How to use it

  1. Choose Encode or Decode.
  2. Select which characters to encode and the entity style.
  3. Copy the output.

Frequently asked questions

Is escaping enough to prevent XSS?

Escaping is correct for HTML text and quoted attribute values, but URLs, JavaScript and CSS contexts need context-specific encoding. Use your framework’s auto-escaping whenever possible.

Esc