home / data / twos-complement-converterlocal
Two's Complement (int256) Converter
Convert signed integers to two's complement hex and back, for int8 up to int256.
twos-complement-converterready · runs in this browser
Runs locally in your browser. Nothing you type is sent anywhere.
data tools · free · runs in your browser · no sign-up · no wallet
01 // about this tool
Solidity stores negative integers in two's complement. -1 as an int256 is 0xff...ff (64 f's). This tool converts a signed number to hex, or reads hex back as signed and unsigned.
02 // how to use it
- Pick a direction and bit size (256 for int256).
- Enter the number or hex.
- Press Run.
03 // faq
What is -1 in int256?
0xffff...ffff, 64 hex characters of f.
Why do I see a huge number for a negative value?
A raw word read as unsigned shows the large value. Read it as signed.