Skip to main content
DevTools24

二进制/文本转换器

将文本转换为二进制表示,反之亦然。支持 UTF-8 编码,包括表情符号。

How it works

  • • Each character is converted to its UTF-8 byte representation
  • • Each byte (8 bits) is shown as a sequence of 0s and 1s
  • • Spaces separate each byte for readability
  • • Emoji and special characters use multiple bytes (UTF-8)

Binary Encoding - 技术详情

Computers store text as binary data. Each character is converted to bytes using an encoding like UTF-8, and each byte is represented as 8 bits (0s and 1s). UTF-8 uses 1-4 bytes per character, with ASCII characters using just 1 byte.

命令行替代方案

# Convert text to binary in bash
echo -n 'Hello' | xxd -b | cut -d' ' -f2-7

# Convert binary to text
echo '01001000 01100101 01101100 01101100 01101111' | perl -lpe '$_=pack"B*",tr/ //dr'