Byte Size Converter
Convert between Bytes, KB, MB, GB, TB, and PB instantly. Supports both binary (KiB, MiB, GiB) and decimal (SI) units. Free online file size calculator for developers.
Byte Size Converter
Unit Type
1 Byte = 8 bits
Decimals
Precision for converted values
Input
🔷 IEC Binary (1024-based)
Common File Sizes
Network Speed Calculator
Calculate download/upload time based on size & speed.
Bytes to KB, MB, GB, TB Converter
A byte size converter translates digital storage values between all common units: Bytes, Kilobytes (KB), Megabytes (MB), Gigabytes (GB), Terabytes (TB), and Petabytes (PB). Understanding data sizes is essential for developers working with file uploads, REST APIs, database storage, network bandwidth limits, and cloud pricing.
This file size calculator supports both the decimal (SI) standard used by storage manufacturers and the binary (IEC) standard used by operating systems, so you always get the right answer for your context.
Binary vs Decimal units: what is the difference?
- Decimal (SI) units: 1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes. Used by storage manufacturers, network providers, and most file size labels.
- Binary (IEC) units: 1 KiB = 1,024 bytes, 1 MiB = 1,048,576 bytes. Used by operating systems (Windows, Linux, macOS) to report RAM and actual file sizes.
- Why this matters: A hard drive advertised as "1 TB" (1,000,000,000,000 bytes) appears as roughly 931 GiB in your operating system. This converter helps you explain that gap to clients or work through it in your code.
How to convert bytes
- Enter a value in any unit field: Bytes, KB, MB, GB, TB, or PB.
- All other fields update instantly.
- Toggle between decimal (SI) and binary (IEC) mode at any time.
- Click any result to copy it to your clipboard.
Developer use cases
- File upload limits: Convert a server-side byte limit (e.g. 10,485,760 bytes) to a human-readable MB value for user-facing error messages.
- API payload size: Quickly check if a JSON response fits within a gateway's 10 MB limit.
- Cloud storage pricing: Convert storage sizes between units when comparing S3, GCS, or Azure pricing tiers.
- Database field sizing: Calculate whether a BLOB column or VARCHAR length is large enough for your expected data.
Quick reference: bytes to KB, MB, GB
- 1 KB = 1,000 bytes (decimal) / 1,024 bytes (binary KiB)
- 1 MB = 1,000,000 bytes (decimal) / 1,048,576 bytes (binary MiB)
- 1 GB = 1,000,000,000 bytes (decimal) / 1,073,741,824 bytes (binary GiB)
- 1 TB = 1,000,000,000,000 bytes (decimal) / 1,099,511,627,776 bytes (binary TiB)
Common byte values and where they come from
Certain byte values show up again and again in error messages and server configs. They are almost always powers of two. Here is the translation table:
- 65,535 bytes = 64 KiB minus 1 byte (65.54 KB decimal). The maximum of a 16-bit unsigned integer: MySQL TEXT column limit, maximum UDP packet size.
- 1,048,576 bytes = 1 MiB (1.05 MB decimal). The base unit operating systems use for "1 MB".
- 5,242,880 bytes = 5 MiB (5.24 MB). A common minimum part size for S3 multipart uploads.
- 10,485,760 bytes = 10 MiB (10.49 MB). The default 10M upload limit in PHP (
upload_max_filesize), nginx (client_max_body_size), and many API gateways. If an upload error mentions this number, your file is over 10 MiB. - 16,777,216 bytes = 16 MiB (16.78 MB). MySQL default
max_allowed_packet, maximum LONGTEXT chunk in many drivers. - 104,857,600 bytes = 100 MiB (104.86 MB). GitHub's hard limit for a single file in a repository.
- 134,217,728 bytes = 128 MiB (134.22 MB). Default HDFS block size and a common serverless memory tier.
- 1,073,741,824 bytes = 1 GiB (1.07 GB). What your OS calls "1 GB" of RAM.
Need to convert other kinds of units too? The Unit Converter handles length, weight, temperature, and CSS units, and the Number Base Converter translates these values between decimal, binary, and hex.
Related
Free forever, no ads, no tracking. Support the project