INT32 - 32-Bit Signed Integer

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

Bit Layout

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

Key Bit Patterns

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

Where INT32 Is Used