Skip to main content

Byte Converter

Convert a size between bytes, KB, MB, GB, TB and PB at once. Uses 1024 as the step, the convention operating systems and developers actually use.

Enter a value in any unit and see it expressed in all of them at once, from bytes up to petabytes. Each step is a factor of 1024, which is the convention your operating system, your programming language and your file listings use.

Byte Converter
B1,048,576
KB1,024
MB1
GB9.765625e-4
TB9.536743e-7
PB9.313226e-10

💡 1 KB = 1,024 B / 1 MB = 1,024 KB / 1 GB = 1,024 MB

// Byte Converter: Features

Why 1024 and not 1000

Memory and addressing are organised in powers of two, so the sizes that matter to a computer fall naturally on multiples of 1024. The prefixes kilo, mega and giga were borrowed from the decimal system where they mean 1000, and the mismatch has caused confusion ever since. This tool uses 1024, because that is what the tools you are comparing against use: file managers, ls, df, language standard libraries and almost every developer-facing display.

The KB and KiB distinction

Standards bodies resolved the ambiguity by introducing separate binary prefixes: KiB, MiB and GiB explicitly mean 1024, 1024 squared and 1024 cubed, leaving KB, MB and GB to mean powers of 1000. Adoption has been uneven. Linux tooling and some file managers use the binary prefixes correctly; Windows displays 1024-based values while labelling them KB and MB; macOS switched to decimal units some years ago. The label alone does not tell you which convention a given number follows.

Why your drive looks smaller than advertised

This is the most familiar consequence. Drive manufacturers use decimal units, so a one terabyte drive holds a trillion bytes. An operating system that divides by 1024 three times reports that as roughly 931 gigabytes. Nothing is missing and nobody is cheating; the two numbers describe the same quantity under different conventions. The gap widens as capacity grows, from about 2.4 per cent at kilobytes to around 10 per cent at terabytes.

Where this matters in practice

Setting an upload limit, a request body cap or a log rotation threshold usually means writing a number of bytes in a configuration file while thinking in megabytes. Estimating what a table will occupy, or what a month of logs will cost to store, means multiplying a per-record size by a row count and then making the result legible. In both cases the conversion is trivial and the mistake of being out by a factor of 1024 is not.

Converting quantities other than bytes

The arithmetic runs in the page and nothing you type is transmitted, stored or logged. For converting other kinds of quantity, the Unit Converter handles length, weight, temperature, volume and more with the same instant-conversion approach.

// Byte Converter: FAQ

Does this use 1024 or 1000?

1024 for every step, so 1 KB is 1,024 bytes and 1 MB is 1,048,576 bytes. That matches what your operating system, your language runtime and your file listings report, which is what you are usually comparing against. Strictly, those values are KiB and MiB.

What is the difference between KB and KiB?

KiB is unambiguous and means exactly 1024 bytes. KB officially means 1000 bytes under the SI convention, but in everyday developer use it very often means 1024. Because the labels are used inconsistently, check which convention a tool follows rather than trusting the letters.

Why does my 1 TB drive show as 931 GB?

Because the manufacturer counted in decimal units and your operating system divided in binary ones. A one terabyte drive holds a trillion bytes; dividing that by 1024 three times gives about 931. Both numbers are correct descriptions of the same capacity.

Which convention should I use in my own software?

Be explicit and be consistent. Store sizes as a plain byte count, and choose one convention for display with a label that matches it: either KiB for 1024 or KB for 1000. The failure mode to avoid is computing in one convention and labelling in the other, which is what causes the confusion in the first place.

How large a value can it handle?

Up to petabytes, which covers any practical file or storage figure. Bear in mind that very large values expressed in bytes exceed what a double-precision number can represent exactly, so treat extremely large byte counts as approximate.

Are network speeds the same thing?

No, and this is a separate trap. Network throughput is quoted in bits per second, not bytes, and a byte is eight bits. A 100 Mbps connection transfers at most about 12.5 MB per second before overhead. Dividing by eight is the first step whenever you move between a link speed and a transfer time.

Does the tool round the results?

Values are shown with enough precision to be useful rather than truncated to whole units, so a size that is not an exact multiple remains recognisable. If you need an exact figure for a configuration file, use the byte value, which is always exact.

Can I paste a value with commas or a unit suffix?

Enter a plain number and choose the unit. Separators and suffixes vary by locale and by tool, so the input is kept deliberately simple to avoid guessing whether a period is a decimal point or a thousands separator.

Why does a file appear to take more space than its size?

Because filesystems allocate in blocks. A file of 100 bytes still occupies a whole block, commonly four kilobytes, so a directory of many tiny files consumes far more space than the sum of their sizes suggests. That is allocation overhead rather than a conversion error.

Is the value I enter sent to a server?

No. The conversion is arithmetic performed in your browser, and nothing you enter leaves the page.

// How to Use Byte Converter

  1. Enter a value

    Type the number you want to convert. It can be a byte count from a configuration file, a size read from a file listing, or an estimate you are working out.

  2. Choose its unit

    Select the unit the value is currently in, from bytes up to petabytes. Every other unit updates at once, so there is no second step.

  3. Read the figure you need

    Take the byte value when writing a configuration limit, since it is always exact, and a larger unit when you need something legible for a document or a discussion.

Category Utilities