Guide · Units

How to Convert Bytes, Bits, KB, MB, and GB

Updated 2026-08-11 · 4 min read

Byte conversion looks like a factor of 1024 until a disk label, a progress bar, and an ISP advert all disagree about the same download. They are usually counting the same bits and dividing by different thousands.

Start from the only unambiguous step: 1 byte = 8 bits. After that you must pick a prefix system and stick to it.

SI kilobytes versus IEC kibibytes

SI (decimal) prefixes, used on drive packaging and many network stats:

  • 1 kB = 10³ B = 1000 B
  • 1 MB = 10⁶ B
  • 1 GB = 10⁹ B
  • 1 TB = 10¹² B

IEC (binary) prefixes, which match how RAM and most OS kernels actually allocate:

  • 1 KiB = 2¹⁰ B = 1024 B
  • 1 MiB = 2²⁰ B = 1,048,576 B
  • 1 GiB = 2³⁰ B = 1,073,741,824 B
  • 1 TiB = 2⁴⁰ B

The ratio GiB/GB is 1.073741824. A 7.4 percent gap at the gigabyte level is enough to start a ticket. At the terabyte level the gap is about 10 percent.

IEC names exist so you can stop writing “KB meaning KiB.” In practice Windows, macOS Finder, and Linux ls still mix labels. Convert the integer byte count if you have it. Convert the label only after you know which prefix the label used.

Bytes bits converter is built for that pair of systems. It runs in the browser; no account.

The 500 GB drive that is “465 GB”

Advertised capacity: 500 GB (SI) = 5.00 × 10¹¹ bytes.

In gibibytes: 5.00 × 10¹¹ / 2³⁰ ≈ 465.66 GiB.

Explorer showing “465 GB” is showing a binary gibibyte count with an SI-looking unit. The factory did not steal 35 GB of NAND; they used a different thousand.

The same mismatch appears in “this ISO is 4.38 GB” versus “4.7 GB DVD.” 4.7 × 10⁹ bytes is a DVD+R marketed size; 4.38 GiB is that count in binary units.

Networks speak bits; files speak bytes

A “100 Mbps” plan is 100 × 10⁶ bits per second (SI megabits, usually). Theoretical byte rate:

100 × 10⁶ / 8 = 12.5 × 10⁶ B/s = 12.5 MB/s (SI).

You will not see 12.5 MB/s on a large download. Ethernet framing, TCP, TLS, and disk write take a cut. Still, if a page claims 100 Mbps and a meter shows 1.2 MB/s, someone confused megabits with megabytes by a factor of ten, not eight.

Wi-Fi “link speed” in Mbit/s is not file-manager MB/s. Convert units first, then complain about radio conditions.

One numeric check: a 2.4 MB JavaScript file

Suppose app.js is 2.4 MB on disk in SI megabytes: 2.4 × 10⁶ = 2,400,000 bytes.

In MiB: 2,400,000 / 1,048,576 ≈ 2.29 MiB.

In bits: 2,400,000 × 8 = 19,200,000 bits = 19.2 Mbit (SI).

If the same file is 2.4 MiB (binary), the byte count is 2.4 × 1,048,576 = 2,516,582.4 bytes ≈ 2.52 MB (SI). Tickets that say “the bundle is 2.4 MB” without SI/IEC are already 5 percent sloppy.

That 2.4 MB on disk is not what the browser downloads. Gzip or Brotli can cut text a lot. Prefix conversion does not estimate compression. For transfer size, use bundle size estimator. For “how many MiB is this MB,” stay on the bytes page.

What not to mix in

Hex dumps and word sizes are a different article: binary, decimal, hex. A 32-bit word is 4 bytes; that is structure, not a prefix.

Base64 expands binary by 4/3. That is encoding overhead, not a kB/KiB debate. Do not “convert” a Base64 string length as if it were file size without dividing out the expansion.

When you paste a result into a spreadsheet, keep the unit in the header (bytes, MiB, Mbit/s). 2.29 alone will be summed with 19.2 next week.

RAM is almost always binary. An “8 GB” DIMM is 8 GiB = 8 × 2³⁰ bytes. Disk marketing is almost always decimal. Mixing those two sentences in one capacity plan is how a “we bought 16 GB” server still OOMs. Convert both to a raw byte count before you add them.

The unit converters hub lists the rest of the physical units. Bytes do not convert to kilograms. If a host bill says “bandwidth 2 TB,” ask whether they mean 2 × 10¹² bytes transferred or 2 TiB. The invoice and the dashboard often disagree by that 10 percent.

Frequently asked questions

How many bits are in a byte?

Eight, in the storage and networking sense used on this page. Convert bits to bytes by dividing by 8. A 100 Mbit/s link is 12.5 MB/s only in the SI-megabyte sense, and only before protocol overhead.

Is 1 kB 1000 bytes or 1024 bytes?

SI says 1 kB = 1000 B. IEC says 1 KiB = 1024 B. Hard-drive boxes use SI. Many operating systems display 1024-based sizes and still print KB or GB. Name the prefix before you argue about a missing 7 percent.

Why does Windows show a smaller capacity than the drive label?

A 500 GB label is 500 × 10⁹ bytes. 500 × 10⁹ / 2³⁰ ≈ 465.7 GiB. Explorer often labels that GiB figure as GB. Neither side is lying about the byte count; they disagree about the divisor.

What is the difference between MB/s and Mbit/s?

MB/s is megabytes per second. Mbit/s (or Mbps) is megabits per second. Divide Mbit/s by 8 to get MB/s in the same prefix system. ISPs advertise bits. File managers show bytes.

Should I use the bytes converter or the bundle size estimator?

Use the bytes converter when you already have a size and need another unit (MiB ↔ MB, bits ↔ bytes). Use the bundle size estimator when you care about transfer size after gzip or Brotli, which is not a prefix conversion.

Does this converter upload my file?

No. You type or paste a number. The conversion runs in the browser. It does not read a disk image to tell you how big the file is; the OS already did that.

More reading that links back to the same tools and workflows.

RoundupCSS & Frontend

Best CSS and Frontend Design Tools

Color palettes, CSS animation previews, favicons, patterns, bundle size, and screen-reader checks - all in the browser.

4 min read