2³¹ − 1 is 2147483647, and it is prime

The largest signed 32-bit integer, 31 ones in binary, and the largest known prime for over a century.

Number bases and coding · Level: Classic result · Updated on 2026-11-10

Put 2147483647 into the base converter and the four lines are HEX 7FFFFFFF, DEC 2147483647, OCT 17777777777 and BIN — thirty-one consecutive ones. That is INT_MAX in C: the number after which a signed 32-bit counter wraps to −2147483648, which is where the Y2038 problem and two decades of rollover incidents come from.

Type the power itself as 2^31-1 and the workbench answers 2.147483647⋅10+9: the display gives up on plain digits as soon as a result reaches 100 000, so a number this long is written with an exponent, and ten significant digits is exactly enough room to keep every one of them. The number is also the eighth Mersenne prime, 2^p − 1 with p = 31, verified by Euler in 1772 and unbeaten as the largest known prime until Lucas's 2¹²⁷ − 1 in 1876.

Answer

2147483647

How to read it

Decimal DEC on the base converter, entered as 2147483647. The workbench's own 2^31-1 prints as 2.147483647⋅10+9.

Source

Marin Mersenne's 1644 list of prime exponents; 2³¹ − 1 proved prime by Leonhard Euler (1772) and remained the largest known prime until Lucas's 2¹²⁷ − 1 (1876)

Work it in the calculator

These links open the right calculator with this problem's numbers already typed in. The line above is what the screen should show — check it yourself.

This is an independent third-party tool site. It is not affiliated with, sponsored by, or authorised by Casio, Texas Instruments or their distributors. Model names and product names are trademarks of their respective owners and appear here only to identify devices.

The keystroke sequences in these manuals were written from this site's own layout data — the same data the online calculator renders — plus publicly available product facts. Specifications and regional configurations are confirmed against the physical device and the manufacturer's most recent material.