loading prices...
prices by coingecko
onchain.search tools/local · 0 uploads/links/about

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

  1. Pick a direction and bit size (256 for int256).
  2. Enter the number or hex.
  3. 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.

04 // related tools

all 19 data tools →