Convert GBK and GB18030 files to UTF-8

A CSV, TXT or subtitle file from mainland China shows � or letters like ÖÐÎÄ instead of Chinese? It is saved in GBK, the legacy code page of Simplified Chinese. Drop the file into the box – Mojibuster detects GBK, GB2312 and GB18030 and converts it to UTF-8, right in your browser.

Works with text and these files:

  • CSV
  • TXT
  • JSON
  • XML
  • SRT
  • VTT
  • SMI
  • TSV
  • MD
  • HTML
  • SQL
  • LOG

For example Excel exports, database dumps, subtitles or website code.

Repair

  1. Drop a file or paste text
  2. It gets repaired automatically
  3. Copy or download
or simply drag a file here

Where GBK files still come from

  • Product data, order exports and invoices from Chinese suppliers – Excel on a Simplified Chinese Windows saves a plain CSV (comma delimited) in GBK.
  • Files saved as “ANSI” in Notepad on a Chinese Windows. Before Windows 10 version 1903 that was the default.
  • Exports from Chinese banks, tax and accounting software that have to go into a system that only accepts UTF-8.
  • Old websites and forum archives (Discuz! in its GBK edition), novels as TXT, Chinese comments in source code. Java before version 18 also wrote files in GBK on a Chinese Windows.
  • Old subtitle files that show garbage on a TV – see fix subtitle encoding.
A GBK file opened with Western settings

Garbled

±±¾©Êг¯ÑôÇø µç»°
Êý¾Ý±àÂë Îļþ

After converting

北京市朝阳区 电话
数据编码 文件

How to convert

  1. Drag the file into the box above or choose it – CSV, TXT, SRT, JSON and other text formats work.
  2. Mojibuster reads the file as GB18030 (which contains GBK and GB2312), Big5 and UTF-8 and keeps the reading that produces real Chinese. The result shows which code page it used.
  3. Wrong guess? Click Read as … in the result to re-read the file in another code page.
  4. Click Download to save the UTF-8 file. For CSV files keep Save with BOM on so Excel opens them correctly.

How to recognize GBK at a glance

  • 中 is D6 D0 in GBK and shows as ÖÐ in a Western program; in UTF-8 it is E4 B8 AD.
  • 文 is CE C4 and shows as ÎÄ.
  • 你好 is C4 E3 BA C3 and shows as ÄãºÃ.

Pairs of accented capitals like Ö, Î and Ä almost always mean GBK text displayed as Windows-1252. The bytes are all still there, so the file converts without loss. Symbols like ¤¤¤å point to Big5 instead. Rare characters like 浣犲ソ are the opposite case: UTF-8 read as GBK – paste that text into the box and Mojibuster turns it back; see what mojibake is.

GB2312, GBK and GB18030

GB2312 has about 6,700 common characters, GBK extends it to more than 20,000, and GB18030 is the national standard that covers all of Unicode (the current edition is GB18030-2022). GB18030 contains everything in GBK, so Mojibuster reads with GB18030 and rare characters convert correctly as well.

Converting on the command line

For many files or a script, standard tools work. On Linux, macOS and Git Bash: iconv -f GB18030 -t UTF-8 in.txt > out.txt. Name the source as GB18030 rather than GBK so rare characters don’t abort the conversion.

In PowerShell 7: Get-Content in.txt -Encoding 936 | Set-Content out.txt -Encoding utf8. Windows PowerShell 5.1 only knows Default, which is the system code page – GBK only on a Chinese Windows. More in fix PowerShell encoding. These commands don’t guess the code page; pick the wrong one and you get new garbage. Mojibuster checks the options for you.

What can’t be restored

Characters that have already become ? or 锟斤拷 are gone: the information was lost when the file was saved. 锟斤拷 is what two UTF-8 replacement characters (EF BF BD) look like when read as GBK – a sure sign the file was converted wrongly and saved before. Mojibuster shows how many such spots the file contains; why they appear is explained under question marks instead of characters.

Frequently asked questions

GBK or GB18030 – which one should I pick?

GB18030 when converting old files. It contains GB2312 and GBK and handles more rare characters. Mojibuster reads with GB18030 by default.

Can I open the converted file in Excel?

Yes. For a CSV, keep Save with BOM on and Excel opens it correctly on double-click – see Excel special characters.

Can I convert UTF-8 back to GBK?

Not here – Mojibuster only saves UTF-8. If you need GBK, save the file again from Excel or an editor; in Notepad++ choose “Convert to ANSI” on a Chinese Windows.

What does 锟斤拷 or 烫烫烫 mean?

锟斤拷 is UTF-8 replacement characters read as GBK: the characters were already lost. 烫烫烫 is not a file encoding problem at all – it is uninitialized memory (0xCC) from a Visual C++ debug build shown as GBK. Neither can be turned back into meaningful text.

Is my file uploaded?

No. The file is read and converted in your browser; nothing is sent to a server. The same goes for Traditional Chinese files – see the Big5 to UTF-8 converter.

More guides