二进制单位换算原理
字节换算基于计算机存储的二进制特性,采用 1024 进位制。1 KB = 1024 B,1 MB = 1024 KB,以此类推。这种设计源于计算机使用二进制(2的幂次方)存储数据的特性。
Preparing your comprehensive developer toolkit
Practical Guide
Convert B, KB, MB, GB, TB, PB (1 KB = 1024 B).
Bytes unit conversion is the process of converting between different data storage units such as bytes (B), kilobytes (KB), megabytes (MB), gigabytes (GB), terabytes (TB), and petabytes (PB). In computing, 1 KB equals 1024 bytes (binary system), not 1000 bytes. This tool helps developers, system administrators, and IT professionals quickly convert between these units for storage capacity planning, file size calculations, and bandwidth estimations.
字节换算基于计算机存储的二进制特性,采用 1024 进位制。1 KB = 1024 B,1 MB = 1024 KB,以此类推。这种设计源于计算机使用二进制(2的幂次方)存储数据的特性。
所有换算都以字节(B)为基准单位,使用 1024 的幂次方作为换算系数(1 KB = 1024 B,1 MB = 1,048,576 B,1 GB = 1,073,741,824 B)。工具使用精确的二进制换算确保准确性。
换算算法采用两步处理:先归一化为字节,再除以目标系数。这种方法防止累积舍入误差,保持9位小数精度。
IEC 60027-2 标准定义了 KiB (1024 B)、MiB (1024² B) 等二进制前缀,与 SI 前缀 KB (1000 B)、MB (1000² B) 区分。本工具使用常见的 1024 进位制。
输入数值或切换单位后,所有字节值即时更新显示。
支持 B、KB、MB、GB、TB、PB 等常用数据存储单位,按 1024 进位。
保持9位小数精度,确保字节换算的准确性。
一键快速切换常用单位,如B、KB、MB、GB等。
Use Bytes Converter when you need to prepare input data for imports, exports, migrations, reports, or handoff between systems.
Convert or inspect values with Bytes Converter while testing APIs, validating payloads, reviewing copied data, or reproducing format issues in development.
Create clean examples with Bytes Converter for README files, tickets, support notes, tutorials, and internal technical documentation.
There's an important distinction: KB (kilobyte) traditionally meant 1024 bytes in computing (2¹⁰), but the SI prefix 'kilo' officially means 1000. To resolve this ambiguity, the IEC 60027-2 standard introduced binary prefixes: KiB (kibibyte) = 1024 bytes, MiB (mebibyte) = 1024² bytes, GiB (gibibyte) = 1024³ bytes. This tool uses the traditional computing convention where 1 KB = 1024 B, which is still widely used in operating systems, memory specifications, and file systems. Some contexts (like hard drive manufacturers) use decimal (1000-based) units, which is why a '1 TB' drive shows as ~931 GB in your OS.
Storage manufacturers (hard drives, SSDs) use decimal (SI) units where 1 KB = 1000 B, 1 MB = 1000² B, etc., for several reasons: 1) SI prefixes officially mean powers of 1000, making it technically correct, 2) It results in larger advertised capacities (a 1 TB drive = 1,000,000,000,000 bytes vs 1,099,511,627,776 bytes for 1 TiB), 3) It's legally accepted as long as clearly stated. However, operating systems use binary (1024-based) units for historical reasons and efficiency (powers of 2 align with computer architecture). This is why a 500 GB drive shows as ~465 GB in Windows - it's the same capacity, just measured differently.
To convert between binary (1024-based) and decimal (1000-based) units: First, convert to bytes as the common base. For binary: Bytes = Value × 1024^n (where n is the unit level: KB=1, MB=2, GB=3). For decimal: Bytes = Value × 1000^n. Then convert to target unit by dividing. Example: 100 GB (decimal) to GiB (binary): 100 × 1000³ = 100,000,000,000 bytes. Then 100,000,000,000 ÷ 1024³ ≈ 93.13 GiB. This tool uses binary (1024) units throughout for consistency with most computer systems and programming applications.
JavaScript's Number type uses IEEE 754 double-precision floating-point format, which can accurately represent integers up to 2⁵³ - 1 (9,007,199,254,740,991 bytes, approximately 8 PB). Beyond this, precision may be lost due to floating-point limitations. For values larger than ~8 PB or requiring absolute precision, consider using BigInt-based converters or specialized tools. This tool maintains 9 decimal places precision for fractional results, which is sufficient for most practical purposes including TB-scale storage calculations, network bandwidth measurements, and file size conversions in typical use cases.
国际电工委员会关于二进制倍数前缀的标准。
信息技术领域量和单位的国际标准,包含字节和比特的定义。
美国国家标准与技术研究院关于二进制前缀的官方指导。
字节单位的详细说明和历史演变,包含 1024 vs 1000 的争议解释。
IEEE 关于二进制倍数前缀(KiB、MiB、GiB)的标准规范。
Open the tool to try these features.