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). A very common configured upload ceiling, not a default: PHP ships
upload_max_filesizeat 2M and nginx shipsclient_max_body_sizeat 1m, so a 10M limit is something an administrator chose. 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.
Frequently Asked Questions
How many MB is 10485760 bytes?
10485760 bytes is exactly 10 MiB (binary) or 10.49 MB (decimal). It shows up in upload errors because 10M is a very common configured limit, not a default: PHP ships upload_max_filesize at 2M and post_max_size at 8M, and nginx ships client_max_body_size at 1m, so a 10M ceiling is something an administrator chose.
How many KB is 65535 bytes?
65535 bytes is 65.54 KB (decimal) or just under 64 KiB (binary). It is the maximum value of a 16-bit unsigned integer, which is why it shows up as the size limit of a MySQL TEXT column, a UDP packet, and many legacy file formats.
Is 1 MB equal to 1000 KB or 1024 KB?
Both, depending on the standard. In decimal (SI) units, 1 MB = 1000 KB, used by storage manufacturers and network providers. In binary (IEC) units, 1 MiB = 1024 KiB, used by operating systems to report RAM and file sizes. This converter supports both modes.
Why does a 1 TB drive show only 931 GB?
Drive manufacturers use decimal units (1 TB = 1,000,000,000,000 bytes), while operating systems report sizes in binary units (1 TiB = 1,099,511,627,776 bytes). The same number of bytes therefore displays as roughly 931 GiB. No storage is missing.
Related
Free forever, no ads, no tracking. Support the project