Data Size Converter — Bytes, KB, MB, GB, TB (SI & IEC)
Convert between bytes, KB, MB, GB, TB, PB and their IEC binary counterparts (KiB, MiB, GiB, TiB). Explains the SI vs IEC difference that causes 'my 1 TB drive shows 931 GB' confusion. 100% local.
Last updated:
CommentsSI (decimal, ×1000)
Used by hard-drive manufacturers, macOS Finder, network speeds.
| BBytes | 1,000,000,000 | |
| KBKilobytes | 1,000,000 | |
| MBMegabytes | 1,000 | |
| GBGigabytes | 1 | |
| TBTerabytes | 0.001 | |
| PBPetabytes | 1.000e-6 |
IEC (binary, ×1024)
Used by RAM specs, Windows, most programming languages.
| BBytes | 1,000,000,000 | |
| KiBKibibytes | 976,562.5 | |
| MiBMebibytes | 953.6743 | |
| GiBGibibytes | 0.931323 | |
| TiBTebibytes | 9.095e-4 | |
| PiBPebibytes | 8.882e-7 |
Frequently Asked Questions
Why does my 1 TB drive show as 931 GB in Windows?
Drive manufacturers use SI units (1 TB = 1,000,000,000,000 bytes). Windows and most operating systems display capacity in IEC binary units but still call them GB (technically GiB, 1 GiB = 1,073,741,824 bytes). 1 TB / 1024³ ≈ 931 GiB — same drive, different accounting.
What's the difference between KB and KiB?
KB (kilobyte, SI) = 1,000 bytes. KiB (kibibyte, IEC) = 1,024 bytes. IEC 80000-13 introduced the -bi- prefixes (kibi, mebi, gibi…) in 1998 so software can be explicit about ×1000 vs ×1024. RAM specs, most Linux tools, and older Windows use ×1024; disks, macOS Finder, and network bandwidth use ×1000.
Which one should I use in code?
Match the audience: user-facing storage labels usually use SI (matches the sticker on the drive), memory allocations and buffer sizes use IEC (matches how RAM is physically organized). Always name your variables and units to avoid ambiguity — 'bytes' as a plain number is safest.
Related Tools
JSON → TypeScript
Convert JSON to TypeScript interfaces instantly. Generate strongly-typed TS types from any JSON sample.
JSON → Go
Convert JSON to Go structs online. Generates idiomatic Go structs with proper json tags and PascalCase field names.
JSON → Python
Convert JSON to Python @dataclass definitions with typed fields. snake_case field names, nested classes, List[T] for arrays, and JSON-key alias comments. 100% local.
JSON → PHP
Convert JSON to PHP 7.4+ classes with typed properties. Generates one class per nested object, phpdoc @var array<T> for typed arrays, and camelCase property names. 100% local.
JSON → Java
Convert JSON to Java POJOs with Jackson @JsonProperty annotations, camelCase field names, List<T> for arrays, and generated getters/setters. Optional package declaration. 100% local.
JSON → C#
Convert JSON to C# classes with System.Text.Json [JsonPropertyName] attributes, PascalCase properties, List<T> for arrays, and optional namespace. Works in .NET 6 / 7 / 8 / 9. 100% local.