Skip to content

Byte Converter

Convert between bytes, bits, kilobytes, megabytes, gigabytes, binary units, and related byte tools.

Decimal Units (1000-based)

bit
8,000,000,000
byte
1,000,000,000
KB
1,000,000
MB
1,000
GB
1
TB
1.0000e-3
PB
1.0000e-6

Binary Units (1024-based)

Bytes
1,000,000,000
KiB
976,562.5
MiB
953.67
GiB
9.3132e-1
TiB
9.0949e-4
PiB
8.8818e-7

Common File Sizes Reference

Text file~10 KB
MP3 song~5 MB
HD video (1hr)~4 GB
Blu-ray movie~50 GB
iPhone photo~3 MB
4K video (1hr)~20 GB
Windows install~20 GB
Steam game~50-100 GB

Need bytes to integer conversion?

File formats, network packets, and embedded systems often store numbers as byte arrays. Use the bytes to int converter when you need a big-endian or little-endian decimal integer from hex bytes.

Open Bytes to Int Converter

Decimal vs Binary Units

Storage manufacturers use decimal units (1 KB = 1000 bytes) while operating systems often display binary units (1 KiB = 1024 bytes). This is why a "500 GB" drive shows as ~465 GiB in your OS.

Decimal (SI)
  • 1 KB = 1,000 bytes
  • 1 MB = 1,000,000 bytes
  • 1 GB = 1,000,000,000 bytes
Binary (IEC)
  • 1 KiB = 1,024 bytes
  • 1 MiB = 1,048,576 bytes
  • 1 GiB = 1,073,741,824 bytes

Code Examples

function formatBytes(bytes, decimals = 2) {
  if (bytes === 0) return '0 Bytes';
  const k = 1024;
  const sizes = ['Bytes', 'KiB', 'MiB', 'GiB', 'TiB'];
  const i = Math.floor(Math.log(bytes) / Math.log(k));
  return parseFloat((bytes / Math.pow(k, i)).toFixed(decimals)) + ' ' + sizes[i];
}

Frequently Asked Questions

What's the difference between KB and KiB?

KB (kilobyte) = 1000 bytes (decimal, SI standard). KiB (kibibyte) = 1024 bytes (binary). Storage manufacturers use decimal; operating systems often use binary, causing confusion about drive sizes.

Why do my storage devices show less space than advertised?

Manufacturers use decimal units (1 GB = 1,000,000,000 bytes) while operating systems display binary units (1 GiB = 1,073,741,824 bytes). A 500 GB drive shows as ~465 GiB.

Popular data size conversions

Related Tools

This tool runs entirely in your browser - nothing you enter is uploaded or stored.

Want to learn the method behind this tool? Read KB vs KiB: 1000 or 1024 Bytes? - the full step-by-step guide.