Number Base Converter

Convert any number between binary, octal, decimal and hexadecimal — type in any box and see all four representations instantly, with step-by-step working.

Enter a value in any base

BIN
base 2
0–1
OCT
base 8
0–7
DEC
base 10
0–9
HEX
base 16
0–9, A–F

Interesting numbers to try

Step-by-step solution

Type a number in any box to see instant conversions and step-by-step working.

Hexadecimal Digits Quick Reference

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 A
11 B
12 C
13 D
14 E
15 F

Number Base Converter Explained

Core concepts, classroom applications, and plain-English explanations for all audiences.

Why computers use different number bases

Every photo you take, every message you send, every video you stream is stored as a sequence of 1s and 0s — binary (base 2). Computers use binary because electronic circuits have two states: on or off. Hexadecimal (base 16) is a shorthand for binary that humans can read: every two hex digits represent one byte.

Worked example

"Convert decimal 25 to binary."

25 ÷ 2 = 12 remainder 1

12 ÷ 2 = 6 remainder 0

6 ÷ 2 = 3 remainder 0

3 ÷ 2 = 1 remainder 1

1 ÷ 2 = 0 remainder 1

Read remainders upward: 11001

Check: 16 + 8 + 0 + 0 + 1 = 25 ✓

Where you see these bases

  • → Base 2 (binary): Inside every processor, hard drive, and memory chip
  • → Base 16 (hex): Colour codes (#FF5733 in CSS/HTML), memory addresses, error codes
  • → Base 60: Minutes and seconds — 60 seconds in a minute, 60 minutes in an hour, inherited from ancient Babylon

Hex letters A–F

Hexadecimal needs 16 digits but we only have 10 numerals, so letters are used: A=10, B=11, C=12, D=13, E=14, F=15. The colour white in web design is #FFFFFF — three bytes all at maximum value (255 in decimal).

Understanding Number Bases: Binary, Octal, Decimal, Hexadecimal

In our daily lives, we count using the decimal system (base 10), which uses ten unique digits (0-9). However, computers operate fundamentally differently. They rely on the binary system (base 2), using only two digits: 0 and 1. This is because computers are built from electronic switches that are either 'on' or 'off', perfectly mapping to these two states.

While binary is essential for computers, long strings of 0s and 1s can be difficult for humans to read and work with. This is where other number bases like octal (base 8) and hexadecimal (base 16) come in. They act as convenient shorthand for binary, making it easier to represent and understand large binary numbers. Our Number Base Converter allows you to effortlessly switch between these systems, showing you the equivalent value in all four bases simultaneously, along with clear, step-by-step conversion methods.

The four bases at a glance

2

Binary

0, 1

Inside every computer and digital device — all data is ultimately stored as 0s and 1s

8

Octal

0 – 7

Unix file permissions, early computing systems, convenient shorthand for binary groups of 3

10

Decimal

0 – 9

Everyday counting — the system everyone learns at school

16

Hexadecimal

0 – 9, A – F

Colours (#FF5733), memory addresses, CSS, HTML, debugging — groups 4 binary bits neatly

Common mistakes to avoid

  • Thinking hexadecimal A is 11, B is 12, etc:People often start counting from 1 for the letters after 9, rather than continuing the sequence from 0-9. Hexadecimal A represents the decimal value 10, B is 11, C is 12, D is 13, E is 14, and F is 15. There are 16 unique digits in total.
  • Incorrectly assigning place values when converting from a base to decimal, e.g., reading powers from left to right starting at base^0:Positional notation dictates that the rightmost digit always corresponds to base^0, and powers increase as you move left. When converting from any base to decimal, the rightmost digit is multiplied by base^0, the next by base^1, and so on. For example, binary 101 = (1 2^2) + (0 2^1) + (1 * 2^0) = 4 + 0 + 1 = 5.
  • Converting binary 11011 to hexadecimal by grouping as '11' and '011' (3 and 3):Binary digits must be grouped in fours (for hex) or threes (for octal) starting from the right. Leading zeros must be added to the leftmost group if it doesn't have enough digits. To convert binary 11011 to hexadecimal, group in fours from the right: 0001 1011. Then convert each group: 0001 is 1, 1011 is B. So, 11011 binary is 1B hexadecimal.

Questions students ask

Why do computers use binary?
Computers use binary (base 2) because their fundamental components, like transistors, operate as simple on/off switches. These two states (on/off) are perfectly represented by the two binary digits (0 and 1). This makes binary the most reliable and efficient way for computers to process and store information.
What is hexadecimal used for?
Hexadecimal (base 16) is primarily used as a compact and human-readable representation of binary numbers. Since each hexadecimal digit corresponds to exactly four binary digits (bits), it's much easier for programmers and engineers to read, write, and debug large binary values, such as memory addresses, colour codes (e.g., #FF0000 for red), MAC addresses, and data dumps, without losing the underlying binary structure.
How do I convert binary to decimal by hand?
To convert binary to decimal, use positional notation. Assign powers of 2 to each binary digit, starting from 2^0 for the rightmost digit, 2^1 for the next, and so on. Multiply each binary digit by its corresponding power of 2, then sum the results. For example, binary 1011 = (1 2^3) + (0 2^2) + (1 2^1) + (1 2^0) = 8 + 0 + 2 + 1 = 11 decimal.
Why is octal used in computing?
Octal (base 8) was historically used in computing as another compact representation for binary, similar to hexadecimal. Each octal digit represents exactly three binary digits. It was common in older systems where data was often grouped in 3-bit or 6-bit chunks. While less common than hexadecimal today, it still appears in some contexts, particularly for setting file permissions in Unix-like operating systems (e.g., chmod 755).
What is the relationship between binary and hexadecimal?
Hexadecimal is a direct shorthand for binary. Since 16 is 2^4, each hexadecimal digit can represent exactly four binary digits (bits). This makes conversion between the two very straightforward: you can group binary digits into sets of four (from the right, adding leading zeros if needed) and convert each group directly to its hexadecimal equivalent, and vice-versa. This direct relationship simplifies working with large binary numbers.