Skip to main content

What Is the Maximum Value of a Uint256 in Solidity?

The maximum value of a uint256 in Solidity is $2^{256} – 1$. This is an extremely large number, approximately $1.15 times 10^{77}$.

The size is chosen to be large enough to prevent the vast majority of legitimate arithmetic operations from overflowing, even when dealing with large token supplies and high precision. This massive number space is a key reason why most smart contract vulnerabilities stem from underflow from zero, not overflow from the maximum.

What Is the Difference between SHA-256 and Keccak-256?
What Is the Typical Block Time for Ethereum and Bitcoin?
What Is the SHA-256 Algorithm?
How Does the Complexity of 2 to the Power of 256 Compare to the Security of a 128-Bit Encryption Key?