HTML Entity Encode/Decode

Safely escape HTML strings for web display.

HTML Entity Encoder & Decoder

Encode HTML character references or decode them with WHATWG-compatible rules, including named, decimal, and hexadecimal formats.

Spec-correct WHATWG HTML5 engine — all 2125 named entities, legacy no-semicolon forms, windows-1252 C1 remap, astral-safe (emoji become a single reference). Note: entities are never decoded inside <script>/<style> by browsers.

Raw Text

Encoded Output

Input: 40 charsOutput: 60 charsEntities: 6

HTML entity tool features

  • Encode as named, decimal, or hexadecimal references.
  • Choose minimal, attribute-safe, non-ASCII, or everything scopes.
  • Decode named and numeric references with WHATWG legacy rules.
  • Inspect searchable named, decimal, and hexadecimal reference values.
  • Prevent double encoding, recursively decode, swap, copy, and download results.

HTML entity encoder FAQ

What is an HTML entity?

An HTML entity, also called a character reference, represents a character such as &lt; or &copy;.

Which HTML entity formats are supported?

Encode with named, decimal, or hexadecimal references; decode named and numeric references.

Does encoding make arbitrary HTML safe?

No. Choose the correct output context and treat encoding as context-specific output handling, not HTML sanitization.

Infinio Tools
© 2026 Infinio Labs