Language: English

tools / binary

binary/

Convert text to binary (0s and 1s) and back, 8 bits per byte. Choose UTF-8, GBK, UTF-16 and more.

Text

Binary

FAQ

How many bits is one Chinese character in binary?

Every byte is written as exactly 8 bits, so the length depends on the charset. In UTF-8 a common Chinese character takes 3 bytes, which is 24 bits: 中 is 11100100 10111000 10101101. In GBK and GB2312 it takes 2 bytes, 16 bits: 中 is 11010110 11010000. English letters and digits take 1 byte; A is 01000001.

Binary to text says the number of bits is not a multiple of 8. What should I do?

Every 8 bits make one byte, so after whitespace is removed the number of bits must be a multiple of 8; otherwise the error tells you how many bits to add or remove at the end. Most often some bits were lost or added while copying. Some sources write only the significant bits of each byte, for example A as 1000001 (7 bits); pad those with leading zeros to 8 bits first, because this tool does not do it for you.

It says a character is not 0 or 1, or my input has a 0b prefix or commas. What should I do?

Only ASCII 0 and 1 are accepted; spaces, line breaks and tabs are ignored. A 0b prefix, commas, hyphens and full-width 0 and 1 are not accepted, and the error points to the character position. Remove or replace them in a text editor and paste again.

Binary to text says the bytes are not valid text, or the result is garbled. What should I do?

It means the bits were not encoded with the current charset, so try another one. For Chinese text the usual ones are UTF-8 and GBK. This tool never shows undecodable bytes as garbage. The one exception is ISO-8859-1: every byte maps to some character, so it never errors, but Chinese text turns into garbled characters. GBK and GB2312 are both decoded with the browser's built-in GB18030 decoder, which is more lenient than Python or Java, so GB2312 also decodes characters that only exist in GBK. If the data was never text (an image, an archive), no charset will decode it.

Why does typing the number 10 not give 1010?

This tool converts the bytes of text, not numeric values. The input 10 is two characters, "1" and "0", which in UTF-8 are 00110001 00110000. Turning the decimal number 10 into the binary number 1010 takes a number base converter, which this tool cannot do.

What is the difference between a space separator and none?

With Space there is one space between bytes; with None the bits run together as one string. The bits of each byte go from high to low, so the leftmost bit is the most significant. Decoding accepts both forms and does not require spaces to fall on byte boundaries; only the total number of bits after whitespace is removed matters.

Why are UTF-16 and UTF-32 results so long?

UTF-16 uses at least 2 bytes per character and adds FE FF (11111110 11111111) at the start, so 中 is 11111110 11111111 01001110 00101101. UTF-32 uses exactly 4 bytes per character, so 中 is 00000000 00000000 01001110 00101101. Both are big-endian.

Is what I enter uploaded?

No. The conversion runs in your browser, makes no network requests and saves nothing.