Skip to content

Base Converter

Convert numbers between binary, octal, decimal and hexadecimal instantly.

-
-
-
-

The detailed guide below is currently available in English only.

How Number Base Conversion Works

📐

Positional Notation

All modern numeral systems rely on positional notation: the contribution of each digit depends on its position and the radix (base). Each step to the left represents an increasingly higher power of the base.

💡

Why Bases Matter in Computing

Modern microprocessors operate strictly on binary (base 2) electrical transistor states. Hexadecimal (base 16) and octal (base 8) serve as compact, human-readable shorthand for binary byte streams and memory pointers.

📊

Understanding Radices

Binary uses symbols 0 and 1. Octal uses digits 0 through 7. Standard decimal uses 0 through 9. Hexadecimal expands beyond 9 using letters A through F (where A=10, B=11, C=12, D=13, E=14, and F=15).

✅

Bit-Grouping Shortcuts

Because 8 = 2³ and 16 = 2⁴, you can convert between binary, octal, and hex by direct grouping: 3 binary bits equal exactly one octal digit, while 4 binary bits (a nibble) equal exactly one hex character.

Mathematical Mechanics of Radix Conversion

In any integer base \(b\), a number represented by the digits \(d_{n-1} d_{n-2} \dots d_1 d_0\) has the exact decimal equivalent value:

Value = (d_{n-1} × b^{n-1}) + (d_{n-2} × b^{n-2}) + … + (d_1 × b^1) + (d_0 × b^0)

To convert an arbitrary decimal integer into a target base \(B\), we perform repeated division by \(B\), recording the integer quotient and the remainder at each step until the quotient reaches 0. The remainders read in reverse order (from bottom to top) form the digits of the target representation:

N_0 = Quotient_0 × B + Remainder_0
Quotient_0 = Quotient_1 × B + Remainder_1 … (until Quotient_k = 0)

Detailed Worked Examples

Example 1: Converting Decimal 250 into Binary, Octal, and Hexadecimal

Decimal to Binary (Base 2):
250 / 2 = 125 remainder 0
125 / 2 = 62 remainder 1
62 / 2 = 31 remainder 0
31 / 2 = 15 remainder 1
15 / 2 = 7 remainder 1
7 / 2 = 3 remainder 1
3 / 2 = 1 remainder 1
1 / 2 = 0 remainder 1
Reading remainders bottom-to-top yields 11111010₂.

Decimal to Octal (Base 8):
250 / 8 = 31 remainder 2
31 / 8 = 3 remainder 7
3 / 8 = 0 remainder 3
Reading remainders bottom-to-top yields 372₈.

Decimal to Hexadecimal (Base 16):
250 / 16 = 15 remainder 10 (which is hex 'A')
15 / 16 = 0 remainder 15 (which is hex 'F')
Reading remainders bottom-to-top yields 0xFA. Notice how 1111 1010 in binary directly splits into 1111 (F) and 1010 (A)!

Example 2: Converting Binary 101101₂ to Decimal

Expanding by powers of 2:
(1 × 2⁵) + (0 × 2⁴) + (1 × 2³) + (1 × 2²) + (0 × 2¹) + (1 × 2⁰)
= 32 + 0 + 8 + 4 + 0 + 1 = 45₁₀.

Quick Reference Table (Values 0 to 15)

Decimal (Base 10) Binary (4-Bit) Octal (Base 8) Hexadecimal (Base 16)
0000000
1000111
2001022
3001133
4010044
5010155
6011066
7011177
81000108
91001119
10101012A
11101113B
12110014C
13110115D
14111016E
15111117F

Frequently Asked Questions

How do you convert decimal to binary?
To convert a decimal integer to binary, repeatedly divide the number by 2 and record the remainder (0 or 1) at each step. Continue dividing until the quotient reaches 0. Then write down the remainders in reverse order, starting from the last remainder calculated to the first.
What is hexadecimal and why is it used in computer science?
Hexadecimal is a base-16 positional numeral system that uses sixteen distinct symbols: 0-9 for values zero to nine, and A-F for values ten to fifteen. It is widely used in computing because one hexadecimal digit corresponds precisely to four binary bits (a nibble), allowing long binary strings such as byte sequences, memory addresses, and RGB color codes to be expressed in a concise, human-readable format.
How do you convert between binary and octal directly?
Because 8 is 2 cubed (2^3), each octal digit corresponds to exactly three binary bits. To convert from binary to octal, group the binary digits into sets of three from right to left (padding with leading zeros if necessary) and replace each 3-bit group with its single-digit octal equivalent.
What is positional notation in number systems?
Positional notation is a system for representing numbers in which each digit's value is determined by its face value multiplied by the base raised to the power of its position index (counting from zero on the right). For example, in decimal 250 = (2*10^2) + (5*10^1) + (0*10^0).