Elecmetric

Number Base Converter

Convert whole numbers between binary, octal, decimal and hexadecimal, with a table of common values and notes on bits, bytes and register addresses.

Binary11111111
Octal377
Decimal255
HexadecimalFF

Common values

DecimalBinaryOctalHexadecimal
0000
1111
21022
410044
81000108
10101012A
15111117F
16100002010
321000004020
64100000010040
100110010014464
12711111111777F
1281000000020080
25511111111377FF
256100000000400100
1000111110100017503E8
40951111111111117777FFF
655351111111111111111177777FFFF

Prefixes and digits

Binary uses the digits 0 and 1 and is often written with the prefix 0b. Octal uses 0 to 7 and the prefix 0o. Hexadecimal uses 0 to 9 and A to F and the prefix 0x. The converter accepts these prefixes, spaces and underscores in the value.

Why engineers use hexadecimal

One hexadecimal digit stands for exactly four bits, so one byte is two hex digits. That is why register addresses, colour codes and protocol frames are written in hex. For example, 0xFF is 255, the largest value that fits in one byte.

Frequently asked questions

How do I convert binary to decimal?

Add the place values of each 1 bit. For 1011, that is 8 + 0 + 2 + 1 = 11. Select binary in the Base list above and the converter does it for you.

How do I convert decimal to hexadecimal?

Divide by 16 repeatedly and read the remainders from last to first, using A to F for 10 to 15. For example, 255 gives 15 and 15, which is FF.

Does it handle negative numbers and fractions?

It handles whole numbers with an optional minus sign. It does not show two's complement and does not convert fractions.

Related

Scientific Notation ConverterDMS to Decimal DegreesdBm to WattsConversion Centre

Tell us how to improve this page

This opens your email app. Nothing is sent until you press send.