HTML Entity Encoder / Decoder

Convert special characters to HTML entities and back. Supports named and numeric entities.

Text
HTML Entities
Common HTML Entities

New tools every week

Get notified. No spam.

How to Encode and Decode HTML Entities

HTML entities replace characters that have special meaning in HTML — < for <, & for &, " for ". This HTML entity encoder converts text to HTML-safe strings and decodes entities back to readable characters, all in your browser.

You'll need HTML encoding when injecting user content into HTML pages (preventing XSS), generating HTML in server-side code, writing content for CMS platforms, or preparing text for email templates. Decoding is useful when scraping HTML content, debugging email rendering, or reading HTML source that's full of entity references.

The tool supports both named entities (&, ©, ) and numeric entities (© for copyright, for snowman). Non-ASCII characters are automatically converted to numeric entities for maximum compatibility across email clients and older browsers.

Tips

  • Always encode user input before inserting it into HTML — this prevents XSS (Cross-Site Scripting) attacks.
  • The five critical characters to always encode: &, <, >, ", and '.
  • Use   (non-breaking space) to prevent line breaks between words that should stay together.
  • Modern browsers handle UTF-8 natively, but HTML entities are still necessary for characters that conflict with HTML syntax.