Calcoid

HTML Character Entities Encoder/Decoder

Encode text to HTML entities or decode entities back to characters. Safe-escape the 5 reserved chars, encode all non-ASCII, or decode named (&), decimal (A), and hex (A) entities. 150+ named-entity table.

HTML character entities encoder and decoder

Escapes only the 5 reserved characters: & < > " '

Named uses &amp; for &, falls back to decimal for chars without a name.

Runs locally in your browser. Nothing is sent to a server.

HTML Reserved Character Entities

CharacterNamed entityDecimal entity
&&amp;&#38;
<&lt;&#60;
>&gt;&#62;
"&quot;&#34;
'&apos;&#39;

Frequently Asked Questions about the HTML Character Entities Encoder/Decoder

Which characters must I escape in HTML?
Escaping depends on context. In ordinary HTML text, ampersand and less-than need encoding when they could start a reference or tag; greater-than is usually optional. In an attribute, encode the quote that delimits the value as well. Safe handling of untrusted content requires context-specific encoding, not one universal five-character replacement.
What is the difference between named, decimal, and hex entities?
A named reference uses a label such as &copy;. Decimal and hexadecimal numeric references use the character's code point, such as &#169; and &#xA9;. HTML defines thousands of named references, often with aliases. Numeric references can represent Unicode scalar values, but invalid values such as surrogate code points are replaced during parsing.
Why does &apos; only work in XHTML, or does it work everywhere now?
&apos; is predefined in XML and supported in modern HTML, but it was not a named reference in HTML 4. Use &#39; when output must remain compatible with an HTML 4 consumer. XML and XHTML parsers support &apos; when the input is valid XML.
How many HTML entities are there?
HTML defines thousands of named character references, and several names can map to the same character. This calculator includes a smaller curated table and uses numeric references when no included name exists. Numeric references cover valid Unicode scalar values; surrogate code points are not valid characters.
When should I use 'Encode all' instead of 'Encode (safe)'?
Use 'Encode all' when you need maximum compatibility with consumers that cannot be trusted to handle UTF-8, such as RSS or Atom feeds read by older aggregators, plain-text email pipelines that downgrade to ASCII, legacy CMS templates, or character-set-confused log parsers. It escapes every non-ASCII character plus the reserved 5, so the output is pure 7-bit ASCII and survives any encoding-mangling step in transit. For normal modern web pages that already declare UTF-8 in their charset, 'Encode (safe)' is enough and keeps the source readable.

Related Calculators

More calculators in "Tech"

See all 98 calculators in "Tech"