Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk2 min

What Is the Maximum Value of a Binary Number?

A binary integer’s maximum depends on its bit width and signedness: unsigned n-bit values reach 2^n − 1, while two’s-complement signed values reach 2^(n−1) − 1.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

There is no single maximum for a binary number: the answer depends on how many bits it has and whether those bits represent an unsigned or signed integer. With n bits, an unsigned integer tops out at 2n − 1; an n-bit two’s-complement signed integer tops out at 2n−1 − 1. An unlimited-length binary numeral has no finite maximum.

How bit width sets the maximum

A fixed-width value made of n bits has 2n possible bit patterns. For an unsigned integer, every pattern represents a nonnegative value, from 0 through 2n − 1. The maximum is the all-ones pattern.

As an Amazon Associate I earn from qualifying purchases.

For example, the 8-bit pattern 11111111 represents 255 when read as unsigned: 28 − 1.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Unsigned and signed maximums compared

Most modern signed integers use two’s-complement representation. Its highest-order bit contributes a negative weight, so an n-bit signed integer ranges from −2n−1 to 2n−1 − 1. The same width can therefore represent a smaller positive maximum when signed, in exchange for representing negative values. The GNU C Language Manual describes unsigned values as using the entire space for nonnegative numbers.

Width Unsigned maximum Signed two’s-complement maximum Signed minimum
8 bits 255 127 −128
16 bits 65,535 32,767 −32,768
32 bits 4,294,967,295 2,147,483,647 −2,147,483,648
64 bits 18,446,744,073,709,551,615 9,223,372,036,854,775,807 −9,223,372,036,854,775,808

For 8 bits, 01111111 is the largest signed pattern and equals 127. The all-ones pattern, 11111111, is −1 in two’s complement, even though it means 255 when interpreted as unsigned.

Why “binary number” needs a width and interpretation

A string of binary digits alone does not establish a maximum. Without a fixed length, another digit can always be added to make a larger nonnegative numeral. For a fixed-width integer, specify both the bit count and whether the value is signed or unsigned.

These formulas concern integer representations. Floating-point formats also use binary bits, but divide them among sign, exponent, and precision fields; their largest finite values are a separate question.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Applying the limits to programming-language types

A mathematical limit for a given width does not automatically tell you the width of a type named int, long, or short. In C, for example, the GNU manual notes that long int can be 32 or 64 bits depending on the system. Check the language rules, platform ABI, and documented limits for the actual type; fixed-width types make the intended width explicit when the language and implementation support them.

As one implementation reference, Microsoft Learn’s C range table, updated August 3, 2021, gives 4,294,967,295 as the maximum for its 32-bit unsigned long and 2,147,483,647 for its 32-bit signed long; it lists 65,535 as the upper bound for unsigned short. These are documented C implementation examples, not universal guarantees for every language or platform. See Microsoft’s range of integer values reference.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What happens at the maximum

Trying to represent a result beyond a type’s range raises an overflow issue. The precise behavior depends on the language and whether the type is signed or unsigned; do not assume that one language’s rules apply to another. The GNU C Language Manual discusses these representation and arithmetic distinctions at Integer Representations.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.