32 vs 64 bit#

What is the difference between a 32bit and a 64bit program?

The amount of memory available:

  • A 32 bit program can use up to 4 gigabytes of memory.

  • A 64 bit program can use up to 18 exabytes[*] of memory.

So, as long as your program needs to use less than 4GB of memory, there’s no real difference. But if you need more than that, you need a 64 bit program.

Math#

Where \(n\) is the number of bits:

\[(1 \underset{n}{\cdots} 1) = \sum_{i=0}^{n-1} 1 × 2^{i}\]

Gives:

  • 32 bit binary 11111111111111111111111111111111 converts to 4,294,967,295 (10 digits).

  • 64 bit binary 1111111111111111111111111111111111111111111111111111111111111111 converts to 18,446,744,073,709,551,615 (20 digits).