Omnikit
DevFilesMoneyAll tools
Ctrl K
Dev toolsFile toolsMoney calculatorsAll tools
HomeDeveloper toolsHTML Entity Encoder & Decoder
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский

HTML Entity Encoder & Decoder

dev

Encode &, <, > and quotes as HTML entities, or decode every named and numeric entity

Runs in your browser. Nothing you type is sent anywhere. Checked against sources on 16 Oct 2026.

An HTML entity writes a character as a reference such as &amp;, &#169; or &#xA9;, so text cannot break the markup around it. Only 5 characters need it in normal HTML: &, <, >, " and '. The standard defines 2,125 named entities; this tool decodes all of them and encodes with the 252 classic names or numbers.

Next:
  • URL Encoder / Decoder Percent-encode or decode text and URLs, and see every part of a link
  • String Escape & Unescape Escape text for a JSON, JavaScript, Java, Python, SQL or CSV string, or unescape it

How to encode or decode HTML entities

1

Paste text or HTML into the Input pane, or click Try an example.

2

Choose Encode to write characters as entities, or Decode to turn entities back into characters.

3

When encoding, pick which characters to encode and whether to write names, decimal or hex numbers.

4

Click Copy, or press Ctrl+Enter, to take the result from the Output pane.

About the HTML Entity Encoder & Decoder

An HTML entity, or character reference, is a way of writing a character with plain ASCII: a name such as &copy;, a decimal number such as &#169;, or a hex number such as &#xA9;. A browser shows all three as ©.

Encoding. Pick how much to encode:

  • Only & < > " ' is what escaping user text needs. These five can end a tag, start one, or close an attribute value early, which is how text turns into markup and, at worst, into a script injection.
  • Plus non-ASCII also writes every accented letter, symbol and emoji as a reference, for a file or a system that cannot carry UTF-8, such as an old email template.
  • Everything encodes all but letters, digits and spaces, which some people use to hide an email address from simple scrapers.

Then choose names, decimal or hex. Names come from the 252 in HTML 4.01, which every browser and mail client knows; characters without one are written as hex numbers. The apostrophe is written &#39;, because &apos; is unknown to HTML 4.

Decoding follows the rules browsers use. All 2,125 names in the HTML standard are known, including the ones that stand for two characters. The 106 legacy names that work without a semicolon, such as &copy 2026, are decoded and flagged. &#0;, surrogates and numbers past U+10FFFF become the replacement character, and &#128; to &#159; are read as Windows-1252, so &#150; is an en dash, as in every browser. Text that is still encoded after one pass, such as &amp;lt;, is pointed out, with a button to decode again.

Everything runs in your browser; nothing you paste is sent anywhere.

Frequently asked questions

Which characters must be escaped in HTML?

Five characters need escaping when text goes into HTML: the ampersand as &amp;, the less-than sign as &lt;, the greater-than sign as &gt;, the double quote as &quot; and the apostrophe as &#39;. Inside element text only & and < are strictly required, but escaping all five also keeps quoted attribute values safe.

What is the difference between &#39; and &apos;?

Both stand for the apostrophe. The name &apos; comes from XML and was added to HTML only in HTML5, so HTML 4 browsers and some older email clients show it literally. The number &#39; works everywhere, which is why encoders, including this one, write the apostrophe as &#39;.

Why does my text show &amp;lt; instead of <?

Text that shows &amp;lt; was encoded twice: the first pass turned < into &lt;, and a second pass turned that ampersand into &amp;. Decode it twice to get the original back. After each pass this tool counts the entities still present and offers one tap to run the decoder again.

Should I use named or numeric HTML entities?

Named entities such as &eacute; are easier to read, while numeric ones such as &#233; or &#xE9; work for every Unicode character, including emoji that have no name. A page saved as UTF-8 needs neither for accents; entities matter mainly for the five special characters and for systems limited to ASCII.

How many HTML entities are there?

The WHATWG HTML standard lists 2,125 named character references, and 106 of them are also accepted without the closing semicolon for compatibility with old pages. HTML 4.01 had 252 names. Any character at all can also be written by its Unicode number, in decimal as &#8364; or in hex as &#x20AC;.

Is the HTML entity for a non-breaking space &nbsp;?

Yes, &nbsp; is the non-breaking space, U+00A0, also written &#160; or &#xA0;. A browser never breaks a line at it and never collapses several of them into one, unlike ordinary spaces. Overusing it for layout makes text hard to reflow on phones, so CSS margins are usually the better tool.

Sources

  • WHATWG HTML Living Standard, 13.5 Named character referencesThe 2,125 entity names the decoder knows, from entities.json
  • WHATWG HTML Living Standard, 13.2.5.72 Character reference stateMissing semicolons, &#0;, surrogates and the Windows-1252 rule for &#128;-&#159;
  • W3C HTML 4.01, 24 Character entity referencesThe 252 names the encoder writes

Last verified 16 October 2026.

Rates and rules change; check the source before you rely on a figure.

Still stuck? Ask about HTML Entity Encoder & Decoder and anybody who knows can answer. No account needed.

Common uses

  • HTML Entity DecoderTurn &amp;, &lt;, &#8217; and every other HTML entity back into readable text
  • HTML Escape & UnescapeEscape text so it is safe inside HTML, or unescape escaped HTML again

Same job, other tools: Base64 Decode – Turn Base64 back into text or a downloadable file · Base64 Encode – Turn text or a file into Base64.

On the related tools: TSV to JSON – Convert tab-separated values, such as a paste from Excel, into JSON.

Related tools

All developer tools
Base64 Encode & DecodeText and files to Base64 and back, with URL-safe mode and image previewUnix Timestamp ConverterUnix timestamps to dates and dates to timestamps, in any time zoneJSON to TypeScriptGenerate TypeScript interfaces or types from a JSON sampleCSV to JSONConvert CSV to JSON and JSON to CSV, with a table previewYAML to JSONConvert YAML to JSON and JSON to YAML, with anchors resolvedURL Encoder / DecoderPercent-encode or decode text and URLs, and see every part of a linkColor ConverterHEX, RGB, HSL, HWB, OKLCH and CMYK in both directions, with a contrast checkNumber Base ConverterBinary, octal, decimal, hex and any base to 36, exact at any size, with two's complement
Was this tool helpful?
Omnikit

Small jobs, done in your browser. Free, fast and private. Files are never uploaded.

Files

  • Compress Image
  • Image to PDF
  • Merge PDF
  • Compress PDF
  • PDF to Word
  • Word to PDF

Dev

  • JSON Formatter & Validator
  • Base64 Encode & Decode
  • JWT Decoder, Verifier & Encoder
  • Password Generator
  • UUID Generator
  • Unix Timestamp Converter

Money

  • SIP Calculator
  • EMI Calculator
  • GST Calculator
  • FD Calculator
  • PPF Calculator
  • Lumpsum Calculator
EnglishالعربيةবাংলাDeutschEspañolFrançaisPolskiPortuguêsРусский
GuidesQuestionsAboutHow we checkLaw library (beta)PrivacyTermsDisclosureContactMore: Exam practice (UGC NET Paper 1)Runs in your browser. Nothing is uploaded. © 2026 Omnikit (theomnikit.com)