FreeToolPark

How many bytes in a GB?

By Updated

A gigabyte in binary is exactly 2 to the 30th power bytes, which works out to 1,073,741,824. Operating systems, RAM chips, and most desktop software use this definition because memory addresses are binary. When you check a file size or free disk space in your OS, that number is in binary bytes.

In decimal SI units, a gigabyte is exactly one billion bytes (1,000,000,000). Drive manufacturers, ISPs, and anything referencing the International System of Units uses this definition. The difference is small at the MB level (about 5%) but grows to 7% at GB, 10% at TB, and keeps widening.

Quick reference: Gigabytes to Bytes

Gigabytes (GB)Bytes (B)
0.5536,870,912
11,073,741,824
22,147,483,648
44,294,967,296
88,589,934,592
1617,179,869,184
3234,359,738,368

Worked examples

  1. Example 1: You are writing a script that processes log files and want to know how many bytes you can fit in 2 GB of memory.

    Calculation: 2 GB × 1,073,741,824 = 2,147,483,648 bytes.

    You can buffer about 2.15 billion bytes. Use binary because RAM is binary.

  2. Example 2: A database row averages 512 bytes. How many rows fit in 1 GB?

    Calculation: 1,073,741,824 ÷ 512 = 2,097,152 rows.

    About 2.1 million rows fit in 1 GB of binary storage at that row size.

  3. Example 3: You transfer 3 GB over a 1 Gbps network connection at full speed.

    Calculation: 3 GB × 1,000,000,000 bytes (decimal, network) = 3,000,000,000 bytes. ÷ 125,000,000 bytes/sec (1 Gbps) = 24 seconds.

    Network transfer time calculations use decimal, not binary.

Frequently asked questions

How many bytes in 1 GB?

1 GB = 1,073,741,824 bytes in binary (what OS tools count) or 1,000,000,000 bytes in decimal (what marketing uses).

Is 1 GB 1 billion bytes?

Only in decimal. In binary (used by operating systems), 1 GB is about 1.074 billion bytes. The 7.4% gap is what causes the 1 TB drive showing 931 GB mystery.

How many bytes in a megabyte?

1 MB equals 1,048,576 bytes in binary or 1,000,000 bytes in decimal.

What is a gibibyte (GiB)?

GiB is the IEC binary term for gigabyte: exactly 1,073,741,824 bytes. It was created to eliminate ambiguity with GB, but almost nobody uses it in practice.

How many bytes in 5 GB?

5 GB = 5,368,709,120 bytes in binary, or 5,000,000,000 bytes in decimal.

Related answers

← Back to all answers