Solidity Integers
Solidity supports 64 different integer types! However, we often default to using uint256
which is more expensive to store than smaller, usually adequate, integer types. For example, for a varible that saves a basis point (a common financial term meaning one hundredth of one percent), which must be between 0-10000, use uint16
.
I initially created this chart with each Solidity integer type and its minimum and maximum value for my own needs. There wasn’t a similar online chart, so I found myself recrating this chart each time I needed it. This time I decided to save and publish it, and I hope you enjoy using this chart too!
Solidity Integer Ranges
uint
Integer Ranges
You may need to scroll horizontally to see the small numbers.
Type | Minimum Value | Maximum Value |
---|---|---|
uint8 |
0 | 255 |
uint16 |
0 | 65535 |
uint24 |
0 | 16777215 |
uint32 |
0 | 4294967295 |
uint40 |
0 | 1099511627775 |
uint48 |
0 | 281474976710655 |
uint56 |
0 | 72057594037927935 |
uint64 |
0 | 18446744073709551615 |
uint72 |
0 | 4722366482869645213695 |
uint80 |
0 | 1208925819614629174706175 |
uint88 |
0 | 309485009821345068724781055 |
uint96 |
0 | 79228162514264337593543950335 |
uint104 |
0 | 20282409603651670423947251286015 |
uint112 |
0 | 5192296858534827628530496329220095 |
uint120 |
0 | 1329227995784915872903807060280344575 |
uint128 |
0 | 340282366920938463463374607431768211455 |
uint136 |
0 | 87112285931760246646623899502532662132735 |
uint144 |
0 | 22300745198530623141535718272648361505980415 |
uint152 |
0 | 5708990770823839524233143877797980545530986495 |
uint160 |
0 | 1461501637330902918203684832716283019655932542975 |
uint168 |
0 | 374144419156711147060143317175368453031918731001855 |
uint176 |
0 | 95780971304118053647396689196894323976171195136475135 |
uint184 |
0 | 24519928653854221733733552434404946937899825954937634815 |
uint192 |
0 | 6277101735386680763835789423207666416102355444464034512895 |
uint200 |
0 | 1606938044258990275541962092341162602522202993782792835301375 |
uint208 |
0 | 411376139330301510538742295639337626245683966408394965837152255 |
uint216 |
0 | 105312291668557186697918027683670432318895095400549111254310977535 |
uint224 |
0 | 26959946667150639794667015087019630673637144422540572481103610249215 |
uint232 |
0 | 6901746346790563787434755862277025452451108972170386555162524223799295 |
uint240 |
0 | 1766847064778384329583297500742918515827483896875618958121606201292619775 |
uint248 |
0 | 452312848583266388373324160190187140051835877600158453279131187530910662655 |
uint256 |
0 | 115792089237316195423570985008687907853269984665640564039457584007913129639935 |
int
Integer Ranges
You may need to scroll horizontally to see the small numbers.
Type | Minimum Value | Maximum Value |
---|---|---|
int8 |
-128 | 127 |
int16 |
-32768 | 32767 |
int24 |
-8388608 | 8388607 |
int32 |
-2147483648 | 2147483647 |
int40 |
-549755813888 | 549755813887 |
int48 |
-140737488355328 | 140737488355327 |
int56 |
-36028797018963968 | 36028797018963967 |
int64 |
-9223372036854775808 | 9223372036854775807 |
int72 |
-2361183241434822606848 | 2361183241434822606847 |
int80 |
-604462909807314587353088 | 604462909807314587353087 |
int88 |
-154742504910672534362390528 | 154742504910672534362390527 |
int96 |
-39614081257132168796771975168 | 39614081257132168796771975167 |
int104 |
-10141204801825835211973625643008 | 10141204801825835211973625643007 |
int112 |
-2596148429267413814265248164610048 | 2596148429267413814265248164610047 |
int120 |
-664613997892457936451903530140172288 | 664613997892457936451903530140172287 |
int128 |
-170141183460469231731687303715884105728 | 170141183460469231731687303715884105727 |
int136 |
-43556142965880123323311949751266331066368 | 43556142965880123323311949751266331066367 |
int144 |
-11150372599265311570767859136324180752990208 | 11150372599265311570767859136324180752990207 |
int152 |
-2854495385411919762116571938898990272765493248 | 2854495385411919762116571938898990272765493247 |
int160 |
-730750818665451459101842416358141509827966271488 | 730750818665451459101842416358141509827966271487 |
int168 |
-187072209578355573530071658587684226515959365500928 | 187072209578355573530071658587684226515959365500927 |
int176 |
-47890485652059026823698344598447161988085597568237568 | 47890485652059026823698344598447161988085597568237567 |
int184 |
-12259964326927110866866776217202473468949912977468817408 | 12259964326927110866866776217202473468949912977468817407 |
int192 |
-3138550867693340381917894711603833208051177722232017256448 | 3138550867693340381917894711603833208051177722232017256447 |
int200 |
-803469022129495137770981046170581301261101496891396417650688 | 803469022129495137770981046170581301261101496891396417650687 |
int208 |
-205688069665150755269371147819668813122841983204197482918576128 | 205688069665150755269371147819668813122841983204197482918576127 |
int216 |
-52656145834278593348959013841835216159447547700274555627155488768 | 52656145834278593348959013841835216159447547700274555627155488767 |
int224 |
-13479973333575319897333507543509815336818572211270286240551805124608 | 13479973333575319897333507543509815336818572211270286240551805124607 |
int232 |
-3450873173395281893717377931138512726225554486085193277581262111899648 | 3450873173395281893717377931138512726225554486085193277581262111899647 |
int240 |
-883423532389192164791648750371459257913741948437809479060803100646309888 | 883423532389192164791648750371459257913741948437809479060803100646309887 |
int248 |
-226156424291633194186662080095093570025917938800079226639565593765455331328 | 226156424291633194186662080095093570025917938800079226639565593765455331327 |
int256 |
-57896044618658097711785492504343953926634992332820282019728792003956564819968 | 57896044618658097711785492504343953926634992332820282019728792003956564819967 |
Notice that int
types are able to hold more negative values that positive ones. For example int8
ranges from -128 to 127.
Until next time!