Back to All Tools

Number Base Converter

Convert between Binary, Octal, Decimal and Hexadecimal.

100% Private — Your data never leaves your browser. Everything runs locally on your device.

How to use the converter

There are four boxes: Decimal (base 10), Binary (base 2), Octal (base 8) and Hexadecimal (base 16). Type a whole number into any one box. The other three boxes update as you type. Hex letters can be typed in upper or lower case. Hex results are always shown in upper case. For example, typing 45 in the Decimal box shows 2D in the Hex box. Leading zeros make no difference: binary 00001111 is decimal 15 and hex F. If you clear a box, the other boxes are cleared too.

How place values work

In decimal, each place is worth 10 times the place to its right: ones, tens, hundreds. Other bases work the same way. Only the multiplier changes. In binary each place is worth 2 times the one to its right. In octal it is 8 times, and in hex 16 times. Let's convert binary 101101 to decimal:

Place value32168421
Binary digit101101
Digit × value3208401

Add the last row: 32 + 8 + 4 + 1 = 45. The same number in the other bases:

Octal 55: 5 × 8 + 5 × 1 = 40 + 5 = 45
Hex 2D: 2 × 16 + D × 1 = 32 + 13 = 45 (D means 13)

So 0b101101 = 45 = 0o55 = 0x2D. The 0b, 0o and 0x prefixes are how many programming languages mark binary, octal and hex. In hex, the letters A to F stand for the values 10 to 15.

Going the other way: decimal to binary

Divide by 2 again and again, and write down each remainder. Then read the remainders from the bottom up:

45 ÷ 2 = 22 remainder 1
22 ÷ 2 = 11 remainder 0
11 ÷ 2 = 5 remainder 1
5 ÷ 2 = 2 remainder 1
2 ÷ 2 = 1 remainder 0
1 ÷ 2 = 0 remainder 1
Bottom to top: 101101

For octal, divide by 8 instead. For hex, divide by 16.

A shortcut between binary, octal and hex

One hex digit is exactly 4 binary digits (bits). One octal digit is exactly 3 bits. So you can convert without going through decimal. Split the binary number into groups, starting from the right. Add zeros on the left if needed:

Groups of 4: 0010 1101 → 2 D → hex 2D
Groups of 3: 101 101 → 5 5 → octal 55

Where you meet each base

What the tool accepts, and what it does not

The converter checks every character you type. If something does not belong, it says so in a red note under the boxes, and the other boxes stay empty. It never shows a result for a number it could not read fully.

Frequently Asked Questions

How do I convert binary to decimal by hand?

Write the place values under the digits from the right: 1, 2, 4, 8, 16, 32 and so on. Add the place values where the digit is 1. For 101101 that is 32 + 8 + 4 + 1 = 45.

Can I convert negative numbers?

Yes, but only with a minus sign. Decimal −45 becomes −101101 in binary and −2D in hex. The tool does not show two's complement, which is how computers usually store negative numbers. In one signed byte, −45 is 11010011.

Can it convert fractions like 12.75?

No. The tool works with whole numbers only. If you type 12.75, it shows a note instead of a result. Delete the .75 to convert 12, which is 1100 in binary.

Is there a limit on how large a number can be?

No. The tool uses exact whole-number maths, so long numbers are not rounded. For example, hex FFFFFFFFFFFFFFFF, the largest 64-bit value, shows as 18446744073709551615 in decimal, which is exactly right.

What happens if I type 102 in the Binary box?

Binary only has the digits 0 and 1, so the tool shows a note that says the 2 is not allowed, and the other boxes stay empty. Commas and decimal points also give a note. Spaces and underscores between digit groups are fine and are ignored.

What does chmod 755 look like in binary?

Octal 755 is binary 111101101 and decimal 493. Split the binary into groups of three: 111 for the owner (read, write, execute), 101 for the group (read, execute) and 101 for everyone else (read, execute).