二进制翻译器

这个二进制翻译器可在文本与二进制代码之间相互转换。输入任意文本即可查看其二进制表示,或粘贴二进制代码(每组 8 位)以使用 ASCII 字符编码将其解码为可读文本。

Binary Translator

Convert text to binary code and binary to text instantly

Frequently Asked Questions

如何将二进制转换为文本?

将二进制字符串拆分为每8位一组(每组一个字节)。使用位置记数法(每位代表2的幂次)将每个8位组转换为十进制值。然后查找该十进制值对应的ASCII字符。例如,01001000 = 十进制72 = ASCII中的"H"。对每个字节重复此步骤以重建完整文本消息。

二进制代码如何表示字母?

二进制代码使用ASCII(美国信息交换标准代码)编码系统来表示字母。每个字母被分配一个唯一的数字:大写A-Z为65-90,小写a-z为97-122。这些数字然后表示为8位二进制值。例如,"A"在十进制中是65,二进制中是01000001。这种标准化映射使全球计算机能一致解释文本。

什么是二进制ASCII?

ASCII是一种字符编码标准,为包括字母、数字、标点和控制字符在内的字符分配数值(0-127)。在二进制中,ASCII使用7位表示128个唯一字符,但通常存储为8位(一个字节),最高位设为0。扩展ASCII使用全部8位支持256个字符,增加了重音字母和国际使用的符号。

如何用二进制写你的名字?

要用二进制写你的名字,将每个字母转换为其ASCII十进制值,然后将该数字转换为8位二进制。例如,名字"Sam"为:S = 83 = 01010011,a = 97 = 01100001,m = 109 = 01101101。完整的二进制表示为01010011 01100001 01101101。字节之间的空格是可选的,但提高了可读性。

一个字符需要多少位?

在标准ASCII编码中,每个字符需要8位(1字节),尽管基本的128字符集只需要7位。在Unicode UTF-8编码中,字符可以使用1到4字节(8到32位),具体取决于字符。基本拉丁字母使用1字节,许多欧洲和中东文字使用2字节,亚洲字符通常使用3字节,表情符号使用4字节。

字母A的二进制代码是什么?

大写"A"的二进制代码是01000001(ASCII十进制65)。小写"a"是01100001(十进制97)。ASCII中大写和小写字母之间的差值恰好是32(二进制00100000),这意味着翻转第6位可以在大小写之间切换。这种优雅的设计使计算机的大小写转换在计算上非常简单。

二进制能表示所有语言吗?

可以,通过Unicode编码。虽然基本ASCII只涵盖英文字母和常见符号(128个字符),但Unicode支持来自世界上几乎所有书写系统的超过149,000个字符,包括中文、阿拉伯文、印地文、日文、韩文和表情符号。Unicode使用可变长度编码(UTF-8、UTF-16、UTF-32)通过1到4字节的二进制数据表示字符。

01001000 01101001在二进制中是什么意思?

01001000是ASCII码72,代表大写字母"H"。01101001是ASCII码105,代表小写字母"i"。合在一起,01001000 01101001拼写为"Hi"。每个8位二进制组使用ASCII编码标准代表一个字符,其中A=65(01000001)、a=97(01100001)、0=48(00110000)、空格=32(00100000)。

ASCII和Unicode有什么区别?

ASCII(美国信息交换标准代码)使用7位表示128个字符,涵盖英文字母、数字和常见符号。Unicode是ASCII的超集,支持所有书写系统中超过149,000个字符,包括中文、阿拉伯文、表情符号和数学符号。ASCII字符在Unicode中占据0-127的位置,因此任何ASCII文本也是有效的Unicode。本翻译器支持ASCII(每字符8位二进制)和扩展Unicode字符(16位二进制)。

如何在Python中将二进制转换为文本?

在Python中,使用int()配合基数2将二进制转换为十进制数,然后使用chr()获取字符:chr(int("01001000", 2))返回"H"。对于完整的二进制字符串,按空格分割并转换每组:"".join(chr(int(b, 2)) for b in binary_string.split())。要将文本转换为二进制,对每个字符使用format(ord(c), "08b"):" ".join(format(ord(c), "08b") for c in text)。

How Binary Translation Works

What is Binary?

Binary is a base-2 number system that uses only two digits: 0 and 1. It is the fundamental language of computers and digital electronics. Every piece of data a computer processes — text, images, audio, and video — is ultimately represented in binary. Each binary digit is called a "bit," and a group of 8 bits forms a "byte," which can represent a single ASCII character.

In a binary number, each position represents a power of 2. Reading from right to left, the positions represent 20 (1), 21 (2), 22 (4), 23 (8), and so on. For example, the binary number 01001000equals 72 in decimal (64 + 8 = 72), which represents the uppercase letter "H" in ASCII.

How Text to Binary Conversion Works

Converting text to binary involves translating each character into its corresponding binary representation. The process follows these steps:

Step 1: Character to ASCII Code

Each character in the input text is mapped to its ASCII (American Standard Code for Information Interchange) numeric value. For example, the letter "A" has an ASCII value of 65.

Step 2: Decimal to Binary

The ASCII numeric value is then converted to its binary equivalent using successive division by 2. The binary number is padded to 8 bits to maintain a standard byte representation.

Step 3: Combine Results

The binary values for each character are combined in order. When spacing is enabled, each 8-bit group is separated by a space for readability.

Example: Converting "Hi" to binary

"H" → ASCII 72 → 01001000

"i" → ASCII 105 → 01101001

Result: 01001000 01101001

ASCII and Binary

ASCII (American Standard Code for Information Interchange) is the character encoding standard that defines a mapping between text characters and numeric values. Standard ASCII uses 7 bits to represent 128 characters (0–127), but in practice each character is stored in a full 8-bit byte. This encoding includes:

  • Control characters (0–31): Non-printable characters like newline, tab, and carriage return
  • Printable characters (32–126): Letters, digits, punctuation, and the space character
  • Uppercase letters (65–90): A through Z in binary range 01000001 to 01011010
  • Lowercase letters (97–122): a through z in binary range 01100001 to 01111010
  • Digits (48–57): 0 through 9 in binary range 00110000 to 00111001

For characters beyond the ASCII range (such as accented letters, emoji, or other Unicode characters), this converter uses 16-bit representation to accurately encode the extended character set.

Binary to Text Conversion

Converting binary back to text reverses the encoding process. The binary string is split into 8-bit groups (bytes), each group is converted to its decimal equivalent, and the decimal value is mapped back to its corresponding ASCII character.

Step 1: Parse Binary Groups

The binary input is split into 8-bit groups. Spaces between groups are optional — the converter handles both spaced and continuous binary input.

Step 2: Binary to Decimal

Each 8-bit group is converted to its decimal value by calculating the sum of each bit multiplied by its positional power of 2.

Step 3: Decimal to Character

The decimal value is looked up in the ASCII table to find the corresponding character. The characters are concatenated to form the output text.

Example: Converting binary to "OK"

01001111 → decimal 79 → "O"

01001011 → decimal 75 → "K"

Result: "OK"

Common Binary Values

The following reference table shows commonly used characters and their binary representations for quick lookup:

CharacterASCII CodeBinary
A6501000001
B6601000010
Z9001011010
a9701100001
b9801100010
z12201111010
04800110000
14900110001
95700111001
(space)3200100000
!3300100001
@6401000000
#3500100011
.4600101110
,4400101100
?6300111111

This table covers commonly used ASCII characters and their 8-bit binary equivalents. Use this binary translator to convert any character instantly.

How to Read Binary Code

Binary is a base-2 number system, meaning it uses only two digits: 0 and 1. Each digit is called a bit (short for "binary digit"). A group of 8 bits is called a byte, and one byte can represent a single character in the ASCII encoding standard.

To read a binary number, you assign each bit a positional value based on powers of 2, starting from the right. The rightmost bit is 20 (1), the next is 21 (2), then 22 (4), and so on up to 27 (128) for the leftmost bit in a byte.

Example: Reading 01001000

Position76543210
Power of 21286432168421
Bit01001000
Value064008000

0×128 + 1×64 + 0×32 + 0×16 + 1×8 + 0×4 + 0×2 + 0×1 = 72= 'H' in ASCII

Simply add up the positional values wherever the bit is 1 and ignore positions where the bit is 0. The resulting decimal number maps to a character via the ASCII table. In this case, 64 + 8 = 72, and ASCII code 72 is the uppercase letter "H".

Binary Alphabet Chart

This complete reference table shows all printable ASCII characters (codes 32–126) with their decimal values and 8-bit binary representations.

CharacterDecimalBinary
(space)3200100000
!3300100001
"3400100010
#3500100011
$3600100100
%3700100101
&3800100110
'3900100111
(4000101000
)4100101001
*4200101010
+4300101011
,4400101100
-4500101101
.4600101110
/4700101111
04800110000
14900110001
25000110010
35100110011
45200110100
55300110101
65400110110
75500110111
85600111000
95700111001
:5800111010
;5900111011
<6000111100
=6100111101
>6200111110
?6300111111
@6401000000
A6501000001
B6601000010
C6701000011
D6801000100
E6901000101
F7001000110
G7101000111
H7201001000
I7301001001
J7401001010
K7501001011
L7601001100
M7701001101
N7801001110
O7901001111
P8001010000
Q8101010001
R8201010010
S8301010011
T8401010100
U8501010101
V8601010110
W8701010111
X8801011000
Y8901011001
Z9001011010
[9101011011
\9201011100
]9301011101
^9401011110
_9501011111
`9601100000
a9701100001
b9801100010
c9901100011
d10001100100
e10101100101
f10201100110
g10301100111
h10401101000
i10501101001
j10601101010
k10701101011
l10801101100
m10901101101
n11001101110
o11101101111
p11201110000
q11301110001
r11401110010
s11501110011
t11601110100
u11701110101
v11801110110
w11901110111
x12001111000
y12101111001
z12201111010
{12301111011
|12401111100
}12501111101
~12601111110

This table covers all 95 printable ASCII characters (codes 32–126). Each character is represented by exactly 8 bits (1 byte). Use the binary translator above to convert any text instantly.

Common Words in Binary

Here are some common words and their binary representations for quick reference and practice:

WordBinary
Hello01001000 01100101 01101100 01101100 01101111
Love01001100 01101111 01110110 01100101
Yes01011001 01100101 01110011
No01001110 01101111
Hi01001000 01101001
OK01001111 01001011

Each letter is converted to its 8-bit ASCII binary equivalent. Spaces between bytes separate individual characters for readability. Try encoding your own words using the translator above.

Use Cases

  • Computer science education: Understanding how computers store and process text data at the binary level
  • Programming and debugging: Inspecting binary data in file formats, network protocols, and memory dumps
  • Data encoding: Working with low-level data representations for serial communication, embedded systems, and IoT devices
  • Cryptography: Analyzing plaintext and ciphertext at the bit level for encryption and decryption operations
  • Digital electronics: Designing and verifying digital circuits that process character data
  • Web development: Understanding character encoding issues and debugging text rendering problems
  • CTF challenges and puzzles: Decoding binary-encoded messages in capture-the-flag competitions and coding puzzles