FREE Standard Delivery for orders over £35 (ex VAT)

Binary / Decimal / Hexadecimal Converter

This tool converts a value between binary, decimal and hexadecimal. Type into any of the three fields and the others update to match. You can pad the result to a fixed 8, 16, 32 or 64-bit word length.

Bit Length Padding:

The three number bases

These are three ways of writing the same number, and you meet all of them when working with microcontrollers and registers.

Decimal is base 10, the everyday system, using the digits 0–9.

Binary is base 2, using only 0 and 1. Each digit is a bit, and it maps directly onto the on/off state of a line or a register bit, which is why it turns up everywhere in digital electronics. Binary numbers get long quickly: the decimal value 255 is 11111111 in binary.

Hexadecimal is base 16, using 0–9 and then A–F for the values 10 to 15. Its usefulness is that one hex digit stands in for exactly four bits, so a byte is always two hex digits and a long string of bits becomes short and readable. That same 255 is FF in hex.

Word length padding

Registers and variables are a fixed width, 8, 16, 32 or 64 bits, and it's often clearer to see a value at its full width, with leading zeros in place, rather than trimmed to its shortest form. The padding option does that: set it to 8-bit and the value 5 shows as 00000101 rather than 101, which makes it easy to line up against a register map or spot which bits are set.