ToolNimba Browse

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

By ToolNimba Editorial Team · Updated 2026-06-19

Type a number in any field. The other three update instantly.

This number base converter turns a value between binary, octal, decimal, and hexadecimal in real time. Type a number into any one of the four fields and the other three update instantly, so you can read off the equivalent in every base at once. Each field only accepts the digits that base allows, so a typo is caught before it gives you a wrong answer. Everything runs in your browser with no upload.

What is the Number Base Converter?

A number base (or radix) is simply how many distinct digit symbols a counting system uses before it rolls over into the next column. Decimal, the base we use every day, has ten digits (0 to 9) and the columns are worth 1, 10, 100, and so on. Binary (base 2) uses just 0 and 1, with columns worth 1, 2, 4, 8, 16. Octal (base 8) uses 0 to 7, and hexadecimal (base 16) uses 0 to 9 then A to F, where A stands for 10 and F for 15. The same quantity looks different in each system, but it is the same number underneath.

Computers run on binary because a transistor is naturally either off or on, which maps cleanly to 0 and 1. Long strings of bits are hard for people to read, so programmers group them. Four bits make exactly one hex digit, which is why hexadecimal is everywhere in computing: memory addresses, colour codes like #FF8800, and byte values are all written in hex. Octal groups bits in threes and shows up in older systems and in Unix file permissions such as chmod 755. Decimal is what humans count in, so converting between these bases is a constant task for anyone working close to the hardware.

Converting is mechanical once you see the pattern. To go from another base to decimal, multiply each digit by its column value (a power of the base) and add the results. To go from decimal back to another base, divide repeatedly by the base and read the remainders from bottom to top. Because 2, 8, and 16 are all powers of two, converting between binary, octal, and hex never needs to pass through decimal at all: you can just regroup the bits. This tool does all of that for you and keeps every field in sync.

When to use it

  • Reading a hex colour code like #1E90FF and finding the decimal RGB values behind it.
  • Converting a binary value from a datasheet or register dump into a decimal or hex number you can use in code.
  • Translating a Unix permission such as 755 (octal) into the underlying bits to understand read, write, and execute flags.
  • Checking a memory address or byte value while debugging low-level code or reading assembly.

How to use the Number Base Converter

  1. Pick the field that matches the base you already have: binary, octal, decimal, or hexadecimal.
  2. Type or paste your number into that field (a leading 0x on hex is accepted and ignored).
  3. Read the equivalent value instantly from the other three fields.
  4. If a character is not allowed for that base, the status line tells you which digits are valid.

Formula & method

To decimal: sum of digit × baseposition, counting positions from 0 on the right.   From decimal: divide by the base repeatedly and read the remainders bottom to top.   Example: binary 101010 = 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 42.

Worked examples

Convert the binary number 101010 to decimal.

  1. Write the column values from the right: 32, 16, 8, 4, 2, 1.
  2. Multiply each bit by its column: 1×32, 0×16, 1×8, 0×4, 1×2, 0×1.
  3. Add the non-zero terms: 32 + 8 + 2 = 42.

Result: Binary 101010 = decimal 42

Convert the decimal number 255 to hexadecimal.

  1. Divide 255 by 16: quotient 15, remainder 15.
  2. Divide the quotient 15 by 16: quotient 0, remainder 15.
  3. Read the remainders bottom to top: 15, 15. In hex 15 is F, so the answer is FF.

Result: Decimal 255 = hex FF (and binary 11111111, octal 377)

Convert the hex number 2A to decimal.

  1. The digit 2 is in the 16s column: 2 × 16 = 32.
  2. The digit A means 10, in the 1s column: 10 × 1 = 10.
  3. Add them: 32 + 10 = 42.

Result: Hex 2A = decimal 42

The same numbers written in each base

DecimalBinaryOctalHex
0000
1111
21022
81000108
10101012A
15111117F
16100002010
42101010522A
25511111111377FF

Hex digit to 4-bit (nibble) cheat sheet

HexDecimalBinary
000000
110001
440100
770111
881000
A101010
C121100
F151111

Common mistakes to avoid

  • Reading hex digits as decimal. In hexadecimal the letters A to F are digits, not text. A is 10, B is 11, up to F which is 15. The hex value 1A is not "one A", it is 1×16 + 10 = 26 in decimal.
  • Forgetting that 10 means different things in each base. "10" is two in binary, eight in octal, ten in decimal, and sixteen in hex. The string of digits alone is meaningless until you know the base, which is why notation like 0x or a subscript matters.
  • Using invalid digits for a base. Binary only allows 0 and 1, and octal only allows 0 to 7. Typing an 8 in a binary or octal field is a mistake, not a large number. This tool blocks it and tells you which digits are valid.
  • Treating a leading zero as octal by accident. In some programming languages a number written with a leading zero, like 011, is read as octal (9 in decimal), not eleven. When you write literals in code, use the explicit 0b, 0o, or 0x prefix to avoid confusion.

Glossary

Base (radix)
The number of distinct digits a counting system uses. Base 10 uses ten digits, base 2 uses two, base 16 uses sixteen.
Binary
Base 2, using only the digits 0 and 1. The native language of digital computers, where each digit is one bit.
Octal
Base 8, using the digits 0 to 7. Each octal digit represents exactly three bits.
Hexadecimal
Base 16, using the digits 0 to 9 and the letters A to F (for 10 to 15). Each hex digit represents exactly four bits.
Bit
A single binary digit, either 0 or 1. The smallest unit of digital information.
Nibble
A group of four bits, which is exactly one hexadecimal digit (0 to F).

Frequently asked questions

How do I convert binary to decimal?

Multiply each binary digit by its column value (a power of two) and add the results. For example 101010 is 32 + 8 + 2 = 42. Just type the binary number into the binary field above and the decimal value appears instantly.

How do I convert decimal to binary?

Divide the decimal number by 2 repeatedly and read the remainders from bottom to top. For example 42 gives the bits 101010. Type your number in the decimal field above to see the binary form at once.

What is FF in decimal?

The hex value FF equals 255 in decimal. F is 15, so FF is 15×16 + 15 = 255. It is also 11111111 in binary, which is the largest value a single 8-bit byte can hold.

Why do programmers use hexadecimal?

Each hex digit maps to exactly four bits, so a byte fits neatly into two hex digits. This makes hex a compact, readable way to write binary values for things like colour codes, memory addresses, and byte data.

What is the difference between octal and hexadecimal?

Octal is base 8 and groups bits in threes using digits 0 to 7. Hexadecimal is base 16 and groups bits in fours using 0 to 9 and A to F. Hex is more common today, while octal still appears in Unix file permissions.

Does this converter handle large numbers?

It converts any whole number up to 2 to the power of 53, which is the largest integer JavaScript can represent exactly. Beyond that the result could be imprecise, so the tool warns you instead of showing a wrong value.