Number Base Converter

One tool for binary ↔ octal ↔ decimal ↔ hexadecimal. Enter a value in any base and see all four representations.

What is a number base?

Every positional number system works the same way — the base just changes how many digits each position can hold. Decimal (base 10) uses ten digits per position; binary (base 2) uses two; hexadecimal (base 16) uses sixteen, borrowing A through F for the extra six. The value a written number represents is identical across all four; only its notation changes.

Programmers reach for hex and binary constantly — colour codes, bitmasks, memory addresses, file signatures — while networking and classic Unix permissions still lean on octal. This tool runs on arbitrary-precision integers, so very large values (32-, 64-, even 256-bit) convert without losing accuracy.

Number base converter, piece by piece

Each card explains one thing this tool does with your input — how it reads the source base, how it writes the target base, and why arbitrary-precision integers matter for large values.

Reading your input — weighted sum of digits

The converter treats every digit in your input as a coefficient multiplied by the source base raised to that digit's position. Summing those products gives the numeric value in "plain integer" form — this is the step that turns your typed string into a number the tool can re-express in any other base.

value = Σ digiti × basei
digit_idigit at position i (rightmost = 0)·basesource base 2–36
F×16F×115·16 + 15·1= 255
Example
Given
FF in base 16
Substitute
15·16 + 15·1
Answer
255

Writing the output — repeated division by the target base

To emit each result the calculator divides the integer value by the target base, records the remainder, and repeats on the quotient until zero. The remainders read bottom-up are the digits of the answer; values 10 and above become letters A, B, C… up to Z for base 36.

nk+1 = ⌊nk / b⌋
digitk = nk mod b
btarget base·n_kquotient at step k, starts at your value
dividequorem→digit255 ÷ 161515 = F15 ÷ 16015 = Fread up → FF₁₆
Example
Given
255 → base 16
Substitute
255 = 15·16 + 15
Answer
FF₁₆

Arbitrary precision — why 256-bit values still convert exactly

The tool runs on JavaScript's native BigInt, so there is no 64-bit wraparound and no floating-point rounding. Address masks, hash digests, and cryptographic constants convert digit-for-digit regardless of length — the four output boxes always show the same exact number in binary, octal, decimal, and hex.

identical value
four notations
2¹²⁸ − 1 in three basesdec: 340282366920938…455hex: FFFF FFFF FFFF FFFF…bin: 1111 1111 1111 1111…same value, three notations
Example
Given
2¹²⁸ − 1
Substitute
convert to hex
Answer
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Digit reference (0–15 across all four bases)

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

Features of this calculator

  • Convert numbers between any two bases from 2 to 36
  • Supports fractional (radix-point) numbers, not just integers
  • Shows the step-by-step division/multiplication working
  • Quick presets for binary, octal, decimal, and hexadecimal
  • Validates digits against the chosen base before converting

Frequently asked questions

+Why is hex used for colours?

Because two hex digits map exactly to one byte (0–255), which is the range of each RGB channel.

+What's the difference between hex A and decimal 10?

They are the same value — hex just uses a single symbol instead of two digits.

+Where is octal still used?

Mostly in Unix file permissions (chmod 755) and a few legacy computing contexts.

Related calculators