INT32 - 32-Bit Signed Integer

The standard signed integer: two's complement encoding for general-purpose computing

Bit Layout

Sign
S
1 bit
Value
31 bits
31 bits

A 32-bit integer stores a whole number using all 32 bits. For signed integers (INT32), the most significant bit is the sign bit (0 = positive, 1 = negative) using two's complement encoding. For the unsigned variant, see UINT32.

Overview

32-bit integers are the most common integer type in computing. They are the default int type in C, C++, Java, C#, and Rust on most platforms. They provide over 4 billion distinct values, sufficient for most counting, indexing, and general-purpose integer operations.

Unlike floating-point formats, integers represent exact values with no rounding error. Every integer within the format's range is perfectly representable. The trade-off is that they cannot represent fractions or very large/small numbers.

Two's Complement

Signed integers use two's complement encoding, where negative numbers are represented by inverting all bits and adding 1. This elegant system has a key property: addition and subtraction work the same way for both signed and unsigned values at the hardware level.

For negative values: -n is encoded as 232 - n

For example, -1 is encoded as 11111111 11111111 11111111 11111111 (all ones), because 232 - 1 = 4,294,967,295.

Asymmetric range Two's complement has one more negative value than positive: INT32 ranges from -2,147,483,648 to +2,147,483,647. This asymmetry occurs because zero uses one of the "positive" patterns, leaving one extra pattern for the negative side.

Range & Properties

PropertySigned (INT32)Unsigned (UINT32)
Total Bits3232
Minimum Value-2,147,483,6480
Maximum Value2,147,483,6474,294,967,295
Representable Values4,294,967,2964,294,967,296

Key Bit Patterns

ValueBit PatternSignedUnsigned
Zero0000000000000000000000000000000000
One0000000000000000000000000000000111
Max Unsigned11111111111111111111111111111111-14294967295
Max Signed0111111111111111111111111111111121474836472147483647
All Ones (-1)11111111111111111111111111111111-14294967295
Min Signed (-2147483648)10000000000000000000000000000000-21474836482147483648

Interactive Bit Visualizer

Click any bit to flip it. See both the signed (two's complement) and unsigned interpretation of the same bit pattern.

Format Comparison

PropertyINT32INT16INT8INT4
Total Bits321684
Signed Min-2,147,483,648-32,768-128-8
Signed Max2,147,483,64732,7671277
Unsigned Max4,294,967,29565,53525515
Step (ULP)1111
Values4,294,967,29665,53625616

Where INT32 Is Used