# DEC, BIN, HEX (Base 2-36) converter / Tool

## Converts binary to 36 decimal numbers to other radixes.

• Decimals are not supported.

## Base Number Conversion Method

Since radix conversion only changes the notation of the number, the value will not change. However, this is only the case when dealing with integers, and is difficult when dealing with decimals. This tool and article do not support decimals.

### Base-N (non-decimal) to decimal

Multiply each n-digit number by $N^0, N^1, ... N^n$ to compute the sum.

e.g. To convert 1101100 in binary to decimal.

$0 \times 2^0+0 \times 2^1 + 1 \times 2^2 + 1 \times 2^3 + 0 \times 2^4 + 1 \times 2^5 + 1 \times 2^6 + 0 = 108$

e.g. To convert 6C in hexadecimal to decimal (C = 12).

$12 \times 16^0 + 6 \times 16^1 = 108$

### Decimal to base-N (non-decimal)

1. Divide the decimal number until the quotient is less than N.
2. Arrange the remainders in order from the last, with the last quotient at the top.

e.g. To convert 108 in decimal to binary.
108 / 2 = 54, remainder of 0
54 / 2 = 27, remainder of 0
27 / 2 = 13, remainder of 1
13 / 2 = 6, remainder of 1
6 / 2 = 3, remainder of 0
3 / 2 = 1, remainder of 1
-> 1101100

In other words, an algorithm that decomposes into the following forms.

$0 + 0 \times 2 + 1 \times 2^2 + 1 \times 2^3 + 0 \times 2^4 + 1 \times 2^5 + 1 \times 2^6 + 0$

e.g. To convert 108 in decimal to hexadecimal.
108 / 16 = 6, remainder of 12 (C)
-> 6C

## Cheat sheet

Dec (10) Bin (2) Qua (4) Oct (8) Hex (16)
1 1 1 1 1
2 10 2 2 2
3 11 3 3 3
4 100 10 4 4
5 101 11 5 5
6 110 12 6 6
7 111 13 7 7
8 1000 20 10 8
Dec (10) Bin (2) Qua (4) Oct (8) Hex (16)
9 1001 21 11 9
10 1010 22 12 A
11 1011 23 13 B
12 1100 30 14 C
13 1101 31 15 D
14 1110 32 16 E
15 1111 33 17 F
16 10000 100 20 10

Hirota Yano / Born in 1987. Programmer.
I am publishing a web tool I created as a hobby. It is free of charge, so please feel free to use it.