Byte Converter
Convert between bytes, bits, kilobytes, megabytes, gigabytes, binary units, and related byte tools.
Decimal Units (1000-based)
8,000,000,0001,000,000,0001,000,0001,00011.0000e-31.0000e-6Binary Units (1024-based)
1,000,000,000976,562.5953.679.3132e-19.0949e-48.8818e-7Common File Sizes Reference
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 ConverterDecimal 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.
- 1 KB = 1,000 bytes
- 1 MB = 1,000,000 bytes
- 1 GB = 1,000,000,000 bytes
- 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
Bytes to Int Converter
Convert hex bytes to signed or unsigned integers using big-endian or little-endian byte order.
Universal Base Converter & Number Inspector
Convert numbers between any bases from 2 to 36 and inspect the result: signed/unsigned views, bit width, byte order, and code snippets.
Binary to Decimal Converter
Convert binary numbers to decimal (base 10) instantly.
This tool runs entirely in your browser - nothing you enter is uploaded or stored.