Skip to main content
DevTools24

字节转换器

在字节、千字节、兆字节、吉字节、太字节和拍字节之间转换。可选择十进制 (SI) 和二进制 (IEC) 单位。

Bytes
0 B
Kilobytes
0 KB
Megabytes
0 MB
Gigabytes
0 GB
Terabytes
0 TB
Petabytes
0 PB
Total Bytes
0

Decimal (SI): 1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes (used by storage manufacturers)

Binary (IEC): 1 KiB = 1,024 bytes, 1 MiB = 1,048,576 bytes (used by operating systems)

Byte Converter - 技术详情

Storage manufacturers use decimal units (1 KB = 1,000 bytes) while operating systems use binary units (1 KiB = 1,024 bytes). This is why a '500 GB' drive shows as ~465 GiB in your OS. The IEC introduced KiB, MiB, GiB to distinguish binary units.

命令行替代方案

# Quick conversions in terminal\nnumfmt --to=iec 1073741824  # → 1.0G\nnumfmt --from=iec 1G        # → 1073741824\n\n# In Python\n>>> 1024**3\n1073741824  # 1 GiB in bytes