Convert between Chinese characters, quwei positions, machine codes and Unicode, with 6763 hanzi and 682 symbols built in
你好世界
汉字编码
1601
16-01
B0A1
5448 3667 2635
All 6763 hanzi plus 682 symbol characters, from 啊 at zone 16 position 01 to 齄 at the very end of zone 87. Nothing missing.
Look up a character's quwei code, or turn quwei and machine codes back into text. Debugging legacy output needs both directions.
Quwei position, machine code, Unicode code point and UTF-8 bytes appear together, so you stop running four separate lookups.
Each character is tagged as level 1 (zones 16–55), level 2 (zones 56–87) or symbol zone, so the coverage is obvious at a glance.
1601, 16-01, 16 01, B0A1, b0a1 and 0xB0A1 all work, and a contiguous string such as B0A1B0A2 is split automatically.
The table ships inside the page and all lookups run in your browser. Your input never reaches a server.
Two tabs at the top: Character to code for lookups, Code to character for decoding. Character to code is the default.
For lookups, type or paste Chinese text. For decoding, enter quwei codes such as 1601 or machine codes such as B0A1, separated by spaces.
The box shows the machine code string of the whole input, or the decoded text. The table below lists all four encodings per character.
The copy table button exports the whole breakdown as tab separated text, ready to paste into Excel or a text editor.
Textbooks and exams still test quwei, GB and machine code conversions, and this verifies the arithmetic instantly
Legacy font libraries store glyphs in quwei order, so you need the offset before extracting a bitmap
Some devices accept Chinese text as GB codes and require the exact byte pair per character
Given a raw double byte hex dump, decoding it tells you what the system was trying to print
Split common and less common characters by zone to keep a webfont small
Compare the coverage of GB2312, GBK and GB18030 to see how Chinese encoding evolved
GB2312 arranges characters on a 94 by 94 grid. The row is called the zone and the column the position, together forming the quwei code. Both numbers are written with two decimal digits, so 啊 is 1601, meaning zone 16 position 01. The grid is partitioned by purpose: zones 1 to 9 hold 682 symbols including punctuation, Greek and Cyrillic letters, pinyin and box drawing characters; zones 10 to 15 are empty; zones 16 to 55 hold 3755 level 1 hanzi ordered by pinyin; zones 56 to 87 hold 3008 level 2 hanzi ordered by radical; zones 88 to 94 are empty and were reserved for future expansion.
These three terms get mixed up constantly, but they form a chain. The quwei code is the grid coordinate in decimal. The GB code adds 0x20 to both the zone and the position, producing two bytes that avoid the ASCII control range. The machine code then adds another 0x80 to each byte, forcing the high bit to 1. Combined, the machine code is simply the quwei code plus 0xA0A0. For 啊: quwei 16-01, GB code 0x3021, machine code 0xB0A1. Both offsets exist for the same reason, to keep Chinese clearly separated from ASCII so legacy systems can detect a double byte character from its high bit alone.
It was a design compromise in GB2312. The 3755 level 1 characters cover over 99 percent of everyday text, and sorting them by pinyin makes manual lookup and simple programmatic indexing easy. The 3008 level 2 characters are far less frequent and their pinyin is less intuitive, so ordering them by radical and stroke count matches how paper dictionaries are browsed. Encoding is identical for both groups; only the ordering differs. One side effect is that sorting by GB code is not sorting by pinyin, because the sequence breaks at the boundary.
They are layered and backward compatible. GB2312 is the 1980 standard with 6763 characters, enough for daily simplified Chinese. GBK extended it in 1995 to 21003 characters, adding traditional forms and many rare ones, and stays fully compatible, so a given character has identical bytes in both. GB18030, standardised after 2000, mixes one, two and four byte sequences and covers more than 70000 characters including all of Unicode. It is the current mandatory standard in mainland China. When a character is missing, the usual reason is not a bug but simply that it never existed in GB2312.
GB2312 was designed for simplified Chinese and only includes 6763 characters, so traditional forms are largely missing. Characters such as 們, 來, 時 and 國 have no quwei code, while their simplified counterparts 们, 来, 时 and 国 do. To handle traditional text in a GB family encoding you need GBK or GB18030. This tool explicitly labels such characters as not in GB2312 rather than producing a plausible but wrong code, which matters because a wrong code is far more misleading than no code when chasing mojibake.
UTF-8 has taken over everyday development, so you rarely need it. It survives in a few corners: computer science exams still test the conversion, embedded bitmap fonts and thermal printers index glyphs by zone and position, legacy debugging requires mapping raw bytes back to quwei codes, and font subsetting is easiest when sliced by zone. Understanding it also explains two things people keep tripping over: why a Chinese character takes two bytes in GBK, and why mixing GBK with UTF-8 produces mojibake.
| Character | Quwei | Machine code | Unicode | UTF-8 bytes | Coverage |
|---|---|---|---|---|---|
| 中 | 54-48 | D6D0 | U+4E2D | E4 B8 AD | Level 1 |
| 国 | 25-90 | B9FA | U+56FD | E5 9B BD | Level 1 |
| 人 | 40-43 | C8CB | U+4EBA | E4 BA BA | Level 1 |
| 民 | 35-81 | C3F1 | U+6C11 | E6 B0 91 | Level 1 |
| 你 | 36-67 | C4E3 | U+4F60 | E4 BD A0 | Level 1 |
| 好 | 26-35 | BAC3 | U+597D | E5 A5 BD | Level 1 |
| 汉 | 26-26 | BABA | U+6C49 | E6 B1 89 | Level 1 |
| 字 | 55-54 | D7D6 | U+5B57 | E5 AD 97 | Level 1 |
| 编 | 17-64 | B1E0 | U+7F16 | E7 BC 96 | Level 1 |
| 码 | 34-75 | C2EB | U+7801 | E7 A0 81 | Level 1 |
| 。 | 01-03 | A1A3 | U+3002 | E3 80 82 | Symbol |
| , | 03-12 | A3AC | U+FF0C | EF BC 8C | Symbol |
| 01-01 | A1A1 | U+3000 | E3 80 80 | Symbol (ideographic space) |