CircuitNote

Quick electronics calculators for lab work and circuit design. Free, no sign-up, works in your browser.

한국어

Values accept SI prefixes. Examples: 4.7k 4k7 100n 10u 20mA 1M

0x

Number Base Converter (Binary, Octal, Decimal, Hex)

Enter one number to see it in binary, octal, decimal and hexadecimal at once. Binary is grouped in fours.

Prefixes such as 0x or 0b and spaces are ignored. For negative numbers use the two's complement calculator.

How the conversion works

To go from decimal to binary, keep dividing by 2 and read the remainders from bottom to top. To go from binary to hex, split the bits into groups of four from the right and turn each group into one digit 0–F (1100 1010 → CA). Octal uses groups of three.

Worked example: 202 in binary, hex and octal

  1. Divide by 2 repeatedly and write down the remainders: 202 ÷ 2 = 101 … 0, 101 ÷ 2 = 50 … 1, 50 ÷ 2 = 25 … 0, 25 ÷ 2 = 12 … 1, 12 ÷ 2 = 6 … 0, 6 ÷ 2 = 3 … 0, 3 ÷ 2 = 1 … 1, 1 ÷ 2 = 0 … 1
  2. Read the remainders from bottom to top: 1100 1010
  3. Split into groups of four for hex: 1100 = C, 1010 = A → 0xCA
  4. Split into groups of three for octal: 011 001 010 → 0o312

Number bases from 0 to 15

DecimalBinaryOctalHex
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Frequently asked questions

How do I convert binary to hexadecimal quickly?

Split the binary number into groups of four bits from the right and replace each group with one hex digit: 1100 1010 becomes CA. Pad the leftmost group with zeros if needed.

Why do programmers use hexadecimal?

One hex digit is exactly four bits, so a byte is always two hex digits. It is far easier to read 0xCA than 11001010 while still mapping directly onto the bits.