Free Tool Two’s Complement 1–1024 Bits Exact BigInt

Signed Integer Range Calculator

Calculate the minimum and maximum value of any signed n-bit integer using two’s-complement representation. Check standard 8-bit, 16-bit, 32-bit, 64-bit or custom widths and inspect total values, binary limits, hexadecimal boundaries, and the exact signed range.

Exact min & max
Custom bit widths
Binary + hex limits
Browser based
8-bit signed integer range
Minimum -128
Maximum 127
±N
Two’s-Complement Range Calculator
SIGNED INTEGER
Signed range formula −2^(n−1) to 2^(n−1)−1
Signed integer range
Minimum value -128
Maximum value 127
Bit width 8 bits
Total values 256
Negative values 128
Nonnegative values 128
Formula exponent n − 1 = 7
Minimum binary 10000000
Maximum binary 01111111
Minimum hex 80
Maximum hex 7F
Overview

What Is a Signed Integer Range?

A signed integer range is the complete set of positive, negative, and zero values that can be represented using a fixed number of binary bits.

Most modern computers represent signed integers using two’s-complement notation. In an n-bit signed integer, the highest-order bit participates in the sign and the remaining bit patterns cover both negative and nonnegative values.

Because half of the available bit patterns correspond to negative values, the signed range is not symmetric around zero. There is always one more negative value than positive values.

2ⁿ Total bit patterns for n bits
−2ⁿ⁻¹ Minimum signed value
2ⁿ⁻¹ − 1 Maximum signed value
Two’s complement Standard signed integer representation
Formula

Signed Integer Range Formula

For an n-bit two’s-complement signed integer, the minimum and maximum values are calculated using:

General n-bit signed range Formula
Minimum: -2^(n – 1) Maximum: 2^(n – 1) – 1 Total representable values: 2^n

For example, an 8-bit signed integer uses n = 8. The exponent is therefore 7, giving a minimum of −2⁷ = −128 and a maximum of 2⁷ − 1 = 127.

Method

How to Calculate the Range of an N-Bit Signed Integer

01
Identify the bit width Let n equal the total number of bits in the signed integer.
02
Calculate n − 1 The signed magnitude boundary is determined by one less than the total bit width.
03
Calculate the minimum The minimum value is negative two raised to the power n − 1.
04
Calculate the maximum The maximum value is two raised to the power n − 1, minus one.
Standard Types

Common Signed Integer Ranges

Type Bits Minimum Maximum Total values
int8 8 -128 127 256
int16 16 -32,768 32,767 65,536
int32 32 -2,147,483,648 2,147,483,647 4,294,967,296
int64 64 -9,223,372,036,854,775,808 9,223,372,036,854,775,807 18,446,744,073,709,551,616
Worked Example

8-Bit Signed Integer Range

Calculate the int8 range 8-bit
Bit width: n = 8 Minimum: -2^(8 – 1) = -2^7 = -128 Maximum: 2^(8 – 1) – 1 = 2^7 – 1 = 127 Signed range: -128 to 127 Total values: 256
16-Bit Example

16-Bit Signed Integer Range

A 16-bit signed integer contains 65,536 possible bit patterns. Half represent negative values and half represent zero plus positive values.

int16 range 16-bit
Minimum: -2^15 = -32,768 Maximum: 2^15 – 1 = 32,767 Range: -32,768 to 32,767
32-Bit Example

32-Bit Signed Integer Range

The 32-bit signed integer remains one of the most commonly encountered integer formats in programming languages, operating systems, file structures, databases, protocols, and APIs.

int32 range 32-bit
Minimum: -2^31 = -2,147,483,648 Maximum: 2^31 – 1 = 2,147,483,647 Total values: 4,294,967,296
64-Bit Example

64-Bit Signed Integer Range

A signed 64-bit integer provides an extremely large whole-number range and is commonly known as int64, long long, signed long on some systems, or BIGINT in database contexts.

int64 range 64-bit
Minimum: -2^63 = -9,223,372,036,854,775,808 Maximum: 2^63 – 1 = 9,223,372,036,854,775,807 Total values: 18,446,744,073,709,551,616
Why Asymmetric?

Why Is the Negative Range One Value Larger?

A signed two’s-complement integer has one more negative value than positive values. For example, int8 runs from −128 through +127 rather than −127 through +127.

This happens because zero uses one of the nonnegative bit patterns. With 256 total 8-bit patterns, 128 patterns are interpreted as negative, while the remaining 128 represent zero through 127.

128 Negative int8 values
1 Zero representation
127 Positive int8 values
256 Total int8 patterns
Binary Limits

Minimum and Maximum Two’s-Complement Bit Patterns

The smallest signed n-bit integer has a binary pattern containing a leading 1 followed entirely by zeros. The largest signed value begins with 0 followed entirely by ones.

Width Minimum binary Maximum binary
4-bit 1000 0111
8-bit 10000000 01111111
16-bit 1000000000000000 0111111111111111
32-bit 10000000000000000000000000000000 01111111111111111111111111111111
Signed vs Unsigned

Signed Integer Range vs Unsigned Integer Range

Signed n-bit integer

Range is −2^(n−1) through 2^(n−1)−1. It includes both negative and nonnegative values.

Unsigned n-bit integer

Range is 0 through 2^n−1. Every available bit contributes to the nonnegative magnitude.

8-bit signed vs unsigned Comparison
Signed 8-bit: -128 to 127 Unsigned 8-bit: 0 to 255 Both formats have: 256 total bit patterns
Overflow

What Happens Outside the Signed Integer Range?

A fixed-width integer cannot directly represent a value smaller than its minimum or larger than its maximum. Attempting to store such a value can cause integer overflow, wrapping, trapping, saturation, or another result depending on the programming language, processor, compiler, or runtime.

For example, decimal 128 cannot be represented as an 8-bit signed integer because the maximum int8 value is 127.

Range checking is especially important when parsing binary data, converting numeric types, validating user input, working with embedded devices, or communicating across systems that use different integer widths.
Practical Uses

Where Signed Integer Range Calculation Is Useful

Programming Check limits before numeric type conversions
Embedded Interpret signed sensor and register widths
Protocols Validate signed binary field boundaries
Databases Compare integer storage ranges

Data type selection

Developers can compare expected application values against the limits of int8, int16, int32, int64, or a custom-width integer before selecting a storage type.

Binary protocol analysis

Signed fields in packet formats often specify an exact number of bits. Calculating the valid range helps verify whether decoded values are possible.

Embedded registers

Sensors and hardware registers frequently use nonstandard widths such as 10, 12, 14, 20, or 24 signed bits. A custom range calculator is especially useful in these situations.

Custom Widths

Signed Ranges for Nonstandard Bit Widths

Integer widths do not need to be limited to powers of two or common CPU sizes. A packed structure or hardware field may use almost any width.

Bits Minimum Maximum
3 -4 3
5 -16 15
10 -512 511
12 -2,048 2,047
24 -8,388,608 8,388,607
Common Mistakes

Signed Integer Range Errors to Avoid

Using the unsigned formula

The maximum unsigned value is 2^n−1, but the signed maximum is only 2^(n−1)−1.

Expecting a symmetric range

Two’s-complement signed ranges contain one more negative value than positive values.

Ignoring the bit width

The exact same decimal number may fit one integer width and overflow another. Width is therefore essential when discussing integer limits.

Using ordinary JavaScript numbers for very large ranges

JavaScript’s standard Number type cannot exactly represent every large integer. This calculator uses BigInt so wide integer boundaries remain exact.

FAQ

Signed Integer Range Calculator FAQs

Common questions about signed integer limits, two’s complement, minimum and maximum values, bit widths, and integer overflow.

For a two’s-complement signed integer, the range is from −2^(n−1) to 2^(n−1)−1.
An 8-bit signed integer ranges from −128 to 127.
A 16-bit signed integer ranges from −32,768 to 32,767.
A 32-bit signed integer ranges from −2,147,483,648 to 2,147,483,647.
A 64-bit signed integer ranges from −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Half of the bit patterns represent negative numbers, while the other half represent zero and positive numbers. Because zero uses one pattern, there is one fewer strictly positive value.
Any n-bit field contains 2^n unique bit patterns, whether the field is interpreted as signed or unsigned.
Signed integers use part of the range for negative values. Unsigned integers use every bit pattern for values from zero upward.
The maximum value is 2^(n−1)−1.
The minimum value is −2^(n−1).
Yes. You can calculate signed ranges for any whole-number bit width from 1 through 1024 bits.
Yes. The calculator uses JavaScript BigInt rather than ordinary floating- point numbers, allowing large integer boundaries to remain exact.
Scroll to Top