FreeToGenerate.com

Forty encodings, 228 names for them, and no forty-first allowed.

Decode some bytes

iso-8859-1resolves to windows-1252

13 · read as hex

The same bytes under four labels

These four labels name four different things and resolve to one encoding, so the four rows below are identical by construction.

The standard, counted

encodings
40
labels
228
current
1
legacy
39
labels on windows-1252
17

This list cannot grow. Section 4.2: the table lists all encodings and labels user agents must support, and user agents must not support any other.

A browser reads all 40 and writes exactly one. TextEncoder has no argument and its encoding is specified to be utf-8; even URL and form submission fall back to UTF-8 for replacement and the two UTF-16 encodings.

All 40 encodings

40 shown
EncodingGroupLabels
UTF-8The encodingunicode-1-1-utf-8 unicode11utf8 unicode20utf8 utf-8 utf8 x-unicode20utf8
IBM866Legacy single-byte866 cp866 csibm866 ibm866
ISO-8859-2Legacy single-bytecsisolatin2 iso-8859-2 iso-ir-101 iso8859-2 iso88592 iso_8859-2 iso_8859-2:1987 l2 latin2
ISO-8859-3Legacy single-bytecsisolatin3 iso-8859-3 iso-ir-109 iso8859-3 iso88593 iso_8859-3 iso_8859-3:1988 l3 latin3
ISO-8859-4Legacy single-bytecsisolatin4 iso-8859-4 iso-ir-110 iso8859-4 iso88594 iso_8859-4 iso_8859-4:1988 l4 latin4
ISO-8859-5Legacy single-bytecsisolatincyrillic cyrillic iso-8859-5 iso-ir-144 iso8859-5 iso88595 iso_8859-5 iso_8859-5:1988
ISO-8859-6Legacy single-bytearabic asmo-708 csiso88596e csiso88596i csisolatinarabic ecma-114 iso-8859-6 iso-8859-6-e iso-8859-6-i iso-ir-127 iso8859-6 iso88596 iso_8859-6 iso_8859-6:1987
ISO-8859-7Legacy single-bytecsisolatingreek ecma-118 elot_928 greek greek8 iso-8859-7 iso-ir-126 iso8859-7 iso88597 iso_8859-7 iso_8859-7:1987 sun_eu_greek
ISO-8859-8Legacy single-bytecsiso88598e csisolatinhebrew hebrew iso-8859-8 iso-8859-8-e iso-ir-138 iso8859-8 iso88598 iso_8859-8 iso_8859-8:1988 visual
ISO-8859-8-ILegacy single-bytecsiso88598i iso-8859-8-i logical
ISO-8859-10Legacy single-bytecsisolatin6 iso-8859-10 iso-ir-157 iso8859-10 iso885910 l6 latin6
ISO-8859-13Legacy single-byteiso-8859-13 iso8859-13 iso885913
ISO-8859-14Legacy single-byteiso-8859-14 iso8859-14 iso885914
ISO-8859-15Legacy single-bytecsisolatin9 iso-8859-15 iso8859-15 iso885915 iso_8859-15 l9
ISO-8859-16Legacy single-byteiso-8859-16
KOI8-RLegacy single-bytecskoi8r koi koi8 koi8-r koi8_r
KOI8-ULegacy single-bytekoi8-ru koi8-u
macintoshLegacy single-bytecsmacintosh mac macintosh x-mac-roman
windows-874Legacy single-bytedos-874 iso-8859-11 iso8859-11 iso885911 tis-620 windows-874
windows-1250Legacy single-bytecp1250 windows-1250 x-cp1250
windows-1251Legacy single-bytecp1251 windows-1251 x-cp1251
windows-1252Legacy single-byteansi_x3.4-1968 ascii cp1252 cp819 csisolatin1 ibm819 iso-8859-1 iso-ir-100 iso8859-1 iso88591 iso_8859-1 iso_8859-1:1987 l1 latin1 us-ascii windows-1252 x-cp1252
windows-1253Legacy single-bytecp1253 windows-1253 x-cp1253
windows-1254Legacy single-bytecp1254 csisolatin5 iso-8859-9 iso-ir-148 iso8859-9 iso88599 iso_8859-9 iso_8859-9:1989 l5 latin5 windows-1254 x-cp1254
windows-1255Legacy single-bytecp1255 windows-1255 x-cp1255
windows-1256Legacy single-bytecp1256 windows-1256 x-cp1256
windows-1257Legacy single-bytecp1257 windows-1257 x-cp1257
windows-1258Legacy single-bytecp1258 windows-1258 x-cp1258
x-mac-cyrillicLegacy single-bytex-mac-cyrillic x-mac-ukrainian
GBKLegacy Chinese (simplified)chinese csgb2312 csiso58gb231280 gb2312 gb_2312 gb_2312-80 gbk iso-ir-58 x-gbk
gb18030Legacy Chinese (simplified)gb18030
Big5Legacy Chinese (traditional)big5 big5-hkscs cn-big5 csbig5 x-x-big5
EUC-JPLegacy Japanesecseucpkdfmtjapanese euc-jp x-euc-jp
ISO-2022-JPLegacy Japanesecsiso2022jp iso-2022-jp
Shift_JISLegacy Japanesecsshiftjis ms932 ms_kanji shift-jis shift_jis sjis windows-31j x-sjis
EUC-KRLegacy Koreancseuckr csksc56011987 euc-kr iso-ir-149 korean ks_c_5601-1987 ks_c_5601-1989 ksc5601 ksc_5601 windows-949
replacementLegacy miscellaneouscsiso2022kr hz-gb-2312 iso-2022-cn iso-2022-cn-ext iso-2022-kr replacement
UTF-16BELegacy miscellaneousunicodefffe utf-16be
UTF-16LELegacy miscellaneouscsunicode iso-10646-ucs-2 ucs-2 unicode unicodefeff utf-16 utf-16le
x-user-definedLegacy miscellaneousx-user-defined

Names, labels and groups come from the WHATWG Encoding Standard's own encodings.json. The decoding is done by your browser, which implements that same standard.

Also available in: Español · Português · Français · العربية

Character Encodings: Every Charset a Browser Knows

The complete list a browser must support, a decoder that runs in yours, and what a label really resolves to.

What is a character encoding?

A file holds bytes. A character encoding is the agreement that turns those bytes into letters — that byte 0x41 is A, that the two bytes 0xC3 0xA9 are é. Get the agreement wrong and you get mojibake: the same bytes read through the wrong table, producing é where é was meant.

There used to be hundreds of these agreements, one per language and vendor. The web narrowed them: the WHATWG Encoding Standard lists exactly 40 encodings and the 228 labels that name them, and it is the rare list that cannot grow. Its own words are that the table lists all encodings and labels user agents must support, and that user agents must not support any other. One of the 40 is current. The remaining 39 sit under headings beginning with the word Legacy.

That closure is the difference between this list and every registry it looks like. A registry records what exists and gains rows. This one is a ceiling.

How to use it

  1. Put some bytes in. Hex digits are read as bytes, so 93 77 6f 72 6c 64 94 is seven of them. Anything else is treated as text and encoded as UTF-8 first, because UTF-8 is the only thing a browser can encode.
  2. Name an encoding. Any of the 228 labels works, in any case. An unrecognised label is a failure rather than a silent fall back, which is what the standard requires.
  3. Read the comparison underneath. The same bytes are decoded under four different labels that all resolve to one encoding, so the four rows come out identical — which is the point.

There is no ASCII encoding, and no Latin-1 either

Ask a browser for ascii and you get windows-1252. Ask for us-ascii, iso-8859-1, latin1, cp819 or ansi_x3.4-1968 and you get windows-1252 again. Seventeen of the 228 labels are piled on that one row, and neither ASCII nor ISO-8859-1 exists in the standard under its own name — while ISO-8859-2 and ISO-8859-15 both do, which makes the missing one a decision rather than an oversight.

It matters because windows-1252 is not ISO-8859-1. Decoding all 256 byte values under both definitions, they differ on 27 of them, and every one of those 27 sits in the range 0x80 to 0x9F, which ISO-8859-1 fills with invisible control codes and Microsoft filled with punctuation. Byte 0x80 is the euro sign. 0x91 to 0x94 are the curly quotes. 0x96 and 0x97 are the en dash and em dash. 0x85 is the ellipsis.

So the characters where the two disagree are exactly the ones a word processor inserts without being asked, which is why a document saved as Latin-1 and served as Latin-1 still shows the right quotation marks — the browser was never using Latin-1. Five of the byte values Microsoft left empty stay as control characters rather than becoming U+FFFD, so nothing in that range ever fails to decode.

This also puts a bound on how much a single-byte encoding can be trusted to be total: across the 28 single-byte encodings, 150 byte slots have no character at all and decode to U+FFFD, spread over nine of them. Every byte being a character is a reasonable assumption and a false one.

Read forty, write one

A browser will decode all 40 of these. It will encode exactly one. The standard specifies the encoding property of a text encoder to be utf-8, and gives its constructor no argument at all, so there is no supported way to ask a browser to write Shift_JIS or windows-1251. Section 4.3 pushes the same rule further out: when URL parsing or form submission needs an output encoding, replacement and both UTF-16 encodings are rewritten to UTF-8 before anything is written.

One entry is stranger than the rest. The encoding named replacement decodes nothing: any non-empty input becomes a single U+FFFD. Six labels point at it, five of them real, deployed encodings — ISO-2022-CN, ISO-2022-KR, HZ-GB-2312 and their aliases. The standard says plainly why: it exists to prevent attacks that abuse a mismatch between the encodings a server supports and the ones a client does. ISO-2022-JP survived the same cull only because too much content depends on it.

One label answers a question people ask and get wrong: utf-16, with no endianness attached, means little-endian. So does the label unicode.

What this page cannot tell you

The decoder here is your browser's, not ours, which is deliberate — it is the only implementation whose answer matters to you, and it is the one the standard is written for. It also means the results can differ from another runtime. Node, for instance, refuses the replacement encoding outright even though the standard requires support for it, so a decode that works here may not work in a script.

Second, this page tells you what a label means, not what a file is. Nothing in a sequence of bytes says which encoding produced it; guessing is a separate and much harder problem, and the honest answer for any file you control is to convert it to UTF-8 and stop guessing.

Third, the standard is a web standard. Databases, terminals and programming languages implement their own tables, and they do not always agree. Compared byte by byte against Python's codecs across all 28 single-byte encodings, 18 are identical and the rest differ on 89 of 7,168 byte positions — mostly where Python refuses a byte Microsoft left undefined and a browser hands back a control character instead. One real disagreement remains, at two positions in KOI8-U, where the two projects inherited different versions of the same encoding.

Why is it free?

The table is a few kilobytes shipped with the page, and the decoding is done by the browser you already have. Nothing you type is uploaded, nothing is logged, and there is no account to make.

No sign-up, no limits, and no watermark on anything you copy out.