%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Integer Type Range Calculator (int8 … int64)

Results update as you type.

Your numbers

Understanding the integer type range calculator — concept and principle

Fixed-width integer types such as int8, int16, int32 and int64 can hold only a limited range of values. Exceeding it causes overflow: the value wraps around, an error is raised, or (in C, for signed types) the behaviour is undefined. Pick a bit width to see the signed range, the unsigned maximum and how many decimal digits the largest value has, which helps when choosing a database column type, a file-format field or a variable for counters and IDs.

Signed and unsigned 32-bit rangesSigned int32 spans −2,147,483,648 to 2,147,483,647; unsigned spans 0 to 4,294,967,295; both hold 2³² values.32 bits = 2³² different values↑ sign bit (signed types)int32 (signed)−2,147,483,6482,147,483,6470uint32 (unsigned)04,294,967,295Same 4,294,967,296 slots, just shifted4294967295largest value has 10 decimal digits
Using the top bit as a sign moves the same range half below zero.

How it is calculated

Values are computed with exact big integers, so even 128-bit results are precise.

The principle

n bits can form 2ⁿ different patterns. Unsigned types assign them to 0 … 2ⁿ − 1. Two's complement gives the top bit a weight of −2ⁿ⁻¹ instead of +2ⁿ⁻¹, so half the patterns become negative. Zero takes one of the non-negative patterns, which is why the negative side has one more value than the positive side. Each bit is worth log₁₀ 2 ≈ 0.301 decimal digits, so 10 bits give about 3 digits (2¹⁰ = 1024 ≈ 10³).

Worked example

  1. Input: 32 bits.
  2. Signed minimum: −2³¹ = −2147483648. Signed maximum: 2³¹ − 1 = 2147483647.
  3. Unsigned maximum: 2³² − 1 = 4294967295.
  4. Digits: 32 × 0.30103 = 9.63, floor is 9, plus 1 = 10; indeed 4294967295 has 10 digits.

How to read the result

Reference points: int8 is −128 … 127 (uint8 up to 255), int16 is −32768 … 32767 (uint16 up to 65535), int64 tops out at 9223372036854775807, about 9.22 × 10¹⁸. A signed 32-bit counter of seconds overflows after about 68 years, which is the Year 2038 problem; a 32-bit ID column runs out at about 2.1 billion rows. For money, measurements or IDs that grow, choose a type with clear headroom.

Common mistakes

Keep in mind: Overflow behaviour depends on the language: Java and C# wrap silently by default, Rust panics in debug builds, and signed overflow in C and C++ is undefined. Check the rules of the language you use.

Frequently asked questions

Why is the minimum −128 and not −127 for int8?

In two's complement, 10000000 means −128; there is only one zero, so one extra negative value remains.

How many bits do I need for a value N?

floor(log₂ N) + 1 bits unsigned, plus one sign bit if negatives are required.

Does Python have int64 limits?

Built-in Python integers have arbitrary precision; fixed limits apply only in libraries such as NumPy.

Sources: ISO/IEC 9899 (C standard), <stdint.h> exact-width integer types · Randal E. Bryant and David R. O'Hallaron, Computer Systems: A Programmer's Perspective, Pearson

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →