Skip to content
Utilities

Data Size Converter

Convert between bits, bytes, kilobytes, megabytes, and gigabytes using both decimal (SI) and binary (IEC) definitions. Useful for flash sizing, SD card capacity planning, and network bandwidth calculations.

Data Size Converter

Convert between bits, bytes, kilobytes, megabytes, and gigabytes using decimal (base 10, SI) definitions where 1 KB = 1000 bytes. Useful for flash memory sizing, SD card capacity planning, network bandwidth calculations, and understanding file and partition sizes. Note: Some systems use binary (IEC) where 1 KiB = 1024 bytes — multiply by 1.024 to convert.

bit×8byte×1KKB×1KMB×1KGBExample: 1 GB = 1,000 MB = 1,000,000 KB = 1,000,000,000 bytes

Type in any field and all others update instantly

Decimal vs binary units

There are two systems, and mixing them up causes most "missing space" confusion:

Decimal (SI)ValueBinary (IEC)Value
1 kB1000 bytes1 KiB1024 bytes
1 MB1 000 000 bytes1 MiB1 048 576 bytes
1 GB10⁹ bytes1 GiB1 073 741 824 bytes

Storage manufacturers use decimal units; operating systems and embedded tools often use binary units but label them "MB". A 32 GB SD card therefore shows as about 29.8 GB in Windows.

In embedded work, flash and RAM sizes are almost always binary: a "4 MB" ESP32 flash is 4 MiB = 4 194 304 bytes, and the Arduino Uno's "32 KB" flash is 32 768 bytes.

Bits vs bytes

A byte is 8 bits. Network speeds are quoted in bits per second (lowercase b): a 115 200 baud serial link is about 11.5 kB/s, and a 100 Mbit/s link moves at most 12.5 MB/s.

Quick examples

  • An SSD1306 128×64 OLED frame buffer is 128 × 64 ÷ 8 = 1024 bytes (1 KiB), half the Uno's RAM.
  • A 240×320 TFT at 16-bit colour needs 240 × 320 × 2 = 153 600 bytes for a full frame, more than an ESP32's largest contiguous RAM block without PSRAM.
  • An hour of 16-bit, 16 kHz mono audio is 16 000 × 2 × 3600 = 115.2 MB.

Worked examples for makers

QuestionWorkingAnswer
How much RAM does an Arduino Uno have?2 KB = 2 × 10242048 bytes
Can a 128×64 OLED frame buffer fit?128 × 64 ÷ 8 bits1024 bytes: half the Uno's RAM
How long to send 1 MB at 115 200 baud?1 048 576 ÷ 11 520 bytes/sabout 91 s
How many 64-byte sensor logs fit on a 4 GB SD card?4 × 10⁹ ÷ 64about 62 million
What is a 16 Mbit flash chip in bytes?16 × 1 048 576 ÷ 82 MiB = 2 097 152 bytes

Bits, bytes and the case of the "b"

Lowercase b means bits and uppercase B means bytes. Flash chips are often sold by megabits (a W25Q32 is 32 Mbit = 4 MiB), while modules and SD cards use bytes. Networking speeds are in bits per second: 1 Mbps moves at most 125 kB/s before protocol overhead.

Why the numbers don't match on your computer

An 8 GB microSD card holds 8 000 000 000 bytes. Windows divides by 1 073 741 824 and shows about 7.45 GB, then the file system takes a little more for tables. Nothing is missing; the two systems just use different units.

Formula, inputs and worked examples

Formula and method

Decimal units use powers of 1000; binary units use powers of 1024. Distinguish kB/MB/GB from KiB/MiB/GiB.

Worked examples

ESP32 flash size

A '4 MB' ESP32 flash chip is 32 Mbit, which is 4 MiB = 4,194,304 bytes. Partition tables work in these binary sizes.

SD card capacity

A card sold as 32 GB holds 32,000,000,000 bytes. A computer using binary units reports 32,000,000,000 / 1,073,741,824 = 29.8 GiB, which is why cards look smaller than advertised.

Network speed

A 1 Mbit/s link moves 1,000,000 / 8 = 125,000 bytes per second (125 kB/s) at best, before protocol overhead.

Inputs

  • Data quantity — Unit: bits or bytes
  • Source unit — Unit: SI or IEC unit
  • Target unit — Unit: SI or IEC unit

What the result means

  • Converted data quantity — Unit: bits / bytes / SI / IEC units

Practical tips and common mistakes

  • Lowercase b means bits and uppercase B means bytes. A speed in Mbps is bits; a file size in MB is bytes.
  • kB, MB and GB use powers of 1000. KiB, MiB and GiB use powers of 1024, so 1 KiB is 1,024 bytes.
  • Microcontroller memory is usually binary: the Arduino Uno's 2 KB of SRAM is 2,048 bytes.
  • Allow for filesystem overhead when planning storage. Usable space is lower than raw capacity.

Assumptions and limitations

  • 1 kB = 1000 bytes; 1 KiB = 1024 bytes.
  • Storage vendors, filesystems, firmware tools, and networking tools may use different conventions.

Frequently asked questions

Is 1 KB 1000 or 1024 bytes?

Strictly, 1 kB (kilobyte) is 1000 bytes and 1 KiB (kibibyte) is 1024 bytes. In practice many tools write KB for 1024; check the context.

How many bytes is 4 MB of flash?

4 MiB = 4 194 304 bytes. Chip and module datasheets use binary units for flash size.

Why does my SD card show less space than advertised?

The card is sold in decimal gigabytes (10⁹ bytes) but the computer reports binary gibibytes (2³⁰ bytes), about 7 % smaller. Formatting overhead takes a little more.

How many bits are in a byte?

Eight. Data rates in bits per second divide by 8 to give bytes per second (before protocol overhead).

Learn more

More Utilities