Back to Home

Base Converter

Convert between Binary, Decimal, Hexadecimal, and Octal

Only 0 and 1

Numbers 0-9

0-9, A-F

Numbers 0-7

📋 Quick Reference (0-15)

DecHexOctBin
0000000
1110001
2220010
3330011
4440100
5550101
6660110
7770111
88101000
99111001
10A121010
11B131011
12C141100
13D151101
14E161110
15F171111

💡 Number Systems

Binary (Base 2)

Uses only 0 and 1. Fundamental to computer systems.

Octal (Base 8)

Uses digits 0-7. Common in Unix file permissions.

Decimal (Base 10)

Standard number system we use daily (0-9).

Hexadecimal (Base 16)

Uses 0-9 and A-F. Common for colors, memory addresses.

Overview

This base converter translates whole numbers between the four number systems used most in computing: binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). Type into any field and the other three update as you type. It is built for programming students, developers reading memory addresses or color codes, and anyone working with file permissions, bit masks or networking.

In a positional number system, each digit is multiplied by a power of the base. Binary 101101 means 1×32 + 0×16 + 1×8 + 1×4 + 0×2 + 1×1 = 45 in decimal. Hexadecimal uses the digits 0–9 plus A–F for the values 10–15, so each hex digit stands for exactly four binary digits, and each octal digit for three. The converter uses arbitrary-precision integers, so very large values stay exact rather than being rounded.

The tool works with non-negative integers only. It does not accept fractions, negative numbers, spaces, or prefixes such as 0x and 0b — type the digits alone. Invalid characters trigger a message explaining which digits that base allows.

How to Use

  1. Type a number into the Binary (Base 2), Decimal (Base 10), Hexadecimal (Base 16) or Octal (Base 8) field.
  2. Use only the digits that base allows: 0–1 for binary, 0–7 for octal, 0–9 for decimal, and 0–9 plus A–F for hex (lowercase letters are capitalized automatically).
  3. Read the converted value in the other three fields. If you type an invalid digit, a red message appears and the other fields clear until you fix it.
  4. Use the Quick Reference table for the values 0–15 in all four bases, and the Number Systems panel for where each base is commonly used.
  5. Click Clear All to empty every field.

Frequently Asked Questions

How do I convert decimal to binary?

Repeatedly divide the number by 2 and record the remainders, then read them from bottom to top. For 45: 45÷2 = 22 r1, 22÷2 = 11 r0, 11÷2 = 5 r1, 5÷2 = 2 r1, 2÷2 = 1 r0, 1÷2 = 0 r1. Reading upward gives 101101. Type 45 in the Decimal field and the Binary field shows 101101, with 2D in hex and 55 in octal.

How do I convert hexadecimal to decimal?

Multiply each hex digit by a power of 16, starting from 16⁰ on the right, and add the results. Letters stand for 10 (A) through 15 (F). For FF: 15×16 + 15×1 = 255. For 1E: 1×16 + 14 = 30. That is why web colors like #1E90FF break down into red 30, green 144 and blue 255. Enter each two-digit pair separately, without the # sign.

Why do programmers use hexadecimal?

Hexadecimal is a compact way to write binary. Because 16 = 2⁴, every hex digit maps to exactly four bits, so one byte (8 bits) is always two hex digits — 11111111 in binary is FF. Long binary values become far easier to read, which is why hex is used for memory addresses, color codes, MAC addresses, byte dumps and character codes.

What are octal numbers used for?

Octal groups binary digits in threes, since 8 = 2³. Its best-known modern use is Unix and Linux file permissions, where each digit encodes read (4), write (2) and execute (1) for the owner, group and others. The permission 755 is binary 111101101 and decimal 493: the owner can read, write and execute, and everyone else can read and execute.

What is the largest number this converter can handle?

There is no fixed limit. Ordinary JavaScript numbers lose precision above 2⁵³ − 1 (9,007,199,254,740,991), so this page uses arbitrary-precision BigInt arithmetic instead. For example, the largest unsigned 64-bit integer, 18,446,744,073,709,551,615, converts exactly to FFFFFFFFFFFFFFFF in hex — sixteen F digits — and 64 ones in binary.

How do I count in binary?

Binary uses only 0 and 1, so each place carries over at 2 instead of 10. Counting from zero gives 0, 1, 10, 11, 100, 101, 110, 111, 1000 — the decimal values 0 through 8. Each new place is worth double the previous one: 1, 2, 4, 8, 16, 32 and so on. The Quick Reference table shows 0 to 15 as four-bit binary values.