tools / Reverse Engineering & CTF

Number Base Converter (hex, dec, binary)

Type a number in any base (prefix it with 0x, 0b or 0o) and read it back in decimal, hex, octal and binary, plus the signed two's complement for a chosen bit width and the byte-swapped value. The small conversions that come up all through RE and exploit work.

decimal
3735928559
hex
0xdeadbeef
octal
0o33653337357
binary
0b11011110101011011011111011101111
two's complement (32-bit signed)
-559038737
byte-swapped (32-bit, endian flip)
0xefbeadde

How it works

Two's complement

For a given bit width, the top bit is the sign. This shows both the raw unsigned value and how it reads as a signed integer, which is where off-by-one and negative-length bugs hide.

Byte swap

The endian flip reverses the byte order for the selected width, so you can turn a big-endian value into the little-endian bytes that x86 actually stores.

FAQ

How do I read a negative number in hex?

Enter it as decimal (like -1), pick the bit width, and the two's complement output shows the hex the machine stores (0xff for -1 at 8 bits).

Related tools

> more from the blog

Mushraf Mustafa logo