home / ethereum / solidity-integer-rangelocal
Solidity Integer Range (uint and int Max Values)
Minimum and maximum of any Solidity integer type, from uint8 to uint256 and int8 to int256, and check if a value fits.
solidity-integer-rangeready · runs in this browser
Runs locally in your browser. Nothing you type is sent anywhere.
ethereum tools · free · runs in your browser · no sign-up · no wallet
01 // about this tool
Solidity integers come in steps of 8 bits. uintN runs from 0 to 2^N - 1, and intN from -2^(N-1) to 2^(N-1) - 1. Since Solidity 0.8 an overflow reverts, so knowing the range matters when packing values.
02 // how to use it
- Type a type such as uint128 or int24.
- Optionally paste a value.
- Press Run.
03 // faq
What is the max uint256?
115,792,089,237,316,195,423,570,985,008,687,907,853,269,984,665,640,564,039,457,584,007,913,129,639,935, or 2^256 - 1.
Why does Uniswap use int24 for ticks?
Ticks fit in 24 bits, which saves storage.