Tools / Number Base Converter

Number Base Converter

Type a number in any base - binary, octal, decimal, or hexadecimal - and all four fields update instantly. The signed 32-bit panel shows how the value is stored in memory, and a bit visualization appears for values that fit in a single byte.

0b
0o
0x

Signed 32-bit interpretation

Signed value
10
Hex (32-bit)
0000000A
Binary (32-bit)
00000000000000000000000000001010

Bit visualization (8-bit)

07
06
05
04
13
02
11
00

How positional notation works

Every positional number system uses a fixed radix (base). In base 10 (decimal), each digit position represents a power of 10. In base 2 (binary), each position is a power of 2 - so the value 1010 in binary means 1×8 + 0×4 + 1×2 + 0×1 = 10 in decimal.

Hexadecimal (base 16) is the format you will encounter most in CTF challenges. One hex digit represents exactly four bits, making it compact for representing binary data. Memory addresses, file headers (magic bytes), and color values are all commonly expressed in hex. For example, the PNG magic bytes are 89 50 4E 47.

The signed 32-bit display shows how computers store integers using two's complement. The highest bit acts as a sign bit: if it is set, the number is negative. This is why casting a large unsigned value like 0xFFFFFFFF to a signed 32-bit integer gives -1.

Challenges solved with this tool: picoCTF 2024 - BinHexa, where you must convert between binary and hex on a timed terminal.

Octal (base 8) appears less frequently than binary or hex in modern CTFs but still shows up in file permission strings and old-school Unix tools. Each octal digit represents three bits, so a full byte spans two octal digits plus a partial third. The chmod permission value 0755, for example, means owner read-write-execute (7 = 111 in binary), group read-execute (5 = 101), and others read-execute. Knowing this helps in forensics challenges that involve filesystem metadata or archive contents.

The signed 32-bit representation panel is useful when a challenge involves integer overflow or type confusion. If a program casts a large positive number to a signed integer, values above 0x7FFFFFFF (2,147,483,647) wrap around to negative. This is a classic vulnerability in C programs and can appear in picoCTF binary exploitation challenges where a size or index check is bypassed by supplying a value that is positive as unsigned but negative as signed.

A quick mental shortcut: to convert a single hex digit to binary, memorize the four-bit patterns for 0--F. The hex digits 0, 4, 8, and C all have binary patterns starting with two zeros. Digits 1, 5, 9, and D start with 0001, 0101, and so on. Fluency with these patterns speeds up manual hex-to-binary conversions during timed challenges significantly.

If you need to convert hex or decimal values to their ASCII character equivalents, use the ASCII Table. For byte-order conversions in memory dumps and binary exploitation, see the Endianness Converter.