Clarks Size Calculator

Byte Size Calculator

Pick a data type, enter how many values you store and the largest number you expect. The calculator gives the total size in bytes, KB and MB, the bits per value and the smallest integer type that still holds your largest number.

  • Bytes per type
  • Memory for many values
  • Smallest integer type
Your data

From 1 to 10000000000000

From 0 to 18000000000000000000

These are raw sizes, as in a binary file, database column or packed array.

Every value takes a fixed number of bytes. A 32-bit integer takes 4 bytes and a 64-bit one takes 8. Ten million 32-bit numbers use 40 MB. If your largest number is under 65,536, a 16-bit type holds it and halves the memory.

Data type sizes

Common types. Search for a type.

Bytes per type
TypeBytesBitsRange or use
Boolean18True or false
8-bit integer180 to 255
16-bit integer2160 to 65,535
32-bit integer4320 to about 4.3 billion
64-bit integer8640 to about 1.8 × 10¹⁹
Float432About 7 digits
Double864About 15 digits
UUID16128Unique id

Unsigned ranges shown for integers.

Bits and bytes

One value. Slide the bits you need.

Each square is a byte of eight bits. Filled bits are in use.

How to work out bytes

Type to memory. Step through it.

Pick the type

Integer, float, id.

Signed integers give up one bit for the sign, so their largest value is half as big.

16-bit, 32-bit or 64-bit integers

Integer widths. Compare them.

Small numbers.

Bytes2
Max unsigned65,535
UseCounts, years

Choosing a type too small causes overflow. Leave room for growth.

Before you choose

Type checks. Tick each item.

Tick each item as you go.

Strings and objects have overhead in memory, so measure them separately.

What you get

Data sizing. Each tile explains one result.

Total

Bytes.

Binary

KiB, MiB.

Per value

Bytes.

Bits

Needed.

Best type

Smallest fit.

One byte is eight bits. A kilobyte is 1,000 bytes, and a kibibyte is 1,024.

Frequently Asked Questions

How many bytes is an integer?

Usually four bytes for a thirty-two bit integer and eight for a sixty-four bit one.

How many bits are in a byte?

Eight.

How many bytes is a double?

Eight bytes.

How do I find the bits needed for a number?

Take the base two logarithm of the number plus one and round up.

What is the difference between KB and KiB?

A KB is one thousand bytes and a KiB is one thousand and twenty-four bytes.

How big is a UUID?

Sixteen bytes stored as binary, or thirty-six characters as text.

Does a boolean really use a whole byte?

Usually yes, though packed bit arrays can store eight in one byte.

Store it lean

Pick the smallest type that safely holds your numbers, and large datasets shrink with no loss.

More size calculators

Each one has its own calculator, worked examples and answers to common questions.

See all size calculators