Number Base Converter

Decimal

255

Other Bases

  • Binary: 11111111
  • Octal: 377
  • Hexadecimal: FF

Compare Calculations

Downloads

Includes your inputs and results for this calculation, plus any additional calculations you've compared.

How This Calculator Works

A number base (or “radix”) is how many distinct digits a numeral system uses before it carries over to the next place value — decimal uses 10 (0–9), binary uses 2 (0–1), octal uses 8 (0–7), and hexadecimal uses 16 (0–9 then A–F). Enter a whole number in any of these four bases, and this calculator shows the same value written in all four at once.

Binary is how computers represent every value internally (each digit is one “bit”); hexadecimal is a common shorthand for binary in programming (each hex digit stands in for exactly 4 binary digits, so it’s far more compact to read and type); octal shows up in older Unix file permissions and some low-level contexts. Decimal is just the everyday base-10 system.

The Formula

Every positional numeral system works the same way: each digit is multiplied by the base raised to its place-value power, then summed:

Value=i=0ndi×Basei\vA{\text{Value}} = \sum_{i=0}^{n} d_i \times \vB{\text{Base}}^i

where did_i is the digit at position ii (counting from 0 at the rightmost digit). Converting to a different base repeatedly divides the decimal value by the new base, recording each remainder — the reverse of the sum above.

Worked Example

Converting binary 11111111 to its other three bases:

  1. Read right to left, each 1 contributes its place value: 27+26+25+24+23+22+21+20=2552^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0 = 255.
  2. Decimal: 255.
  3. Octal: dividing 255 by 8 repeatedly (255 ÷ 8 = 31 r7, 31 ÷ 8 = 3 r7, 3 ÷ 8 = 0 r3) reads the remainders bottom-to-top as 377.
  4. Hexadecimal: 255 ÷ 16 = 15 r15, 15 ÷ 16 = 0 r15 — both remainders are 15 (F in hex), giving FF.

Source: Standard positional numeral system conversion.

Frequently Asked Questions

What is a number base (radix)?

A number base is how many distinct digits a numeral system uses before carrying over to the next place value. Decimal (base 10) uses digits 0-9; binary (base 2) uses only 0 and 1; octal (base 8) uses 0-7; hexadecimal (base 16) uses 0-9 then the letters A-F to represent 10-15.

Why do computers use binary?

Computer hardware is built from switches that are only ever fully on or fully off, which maps naturally onto binary's two digits (1 and 0). Every value a computer stores or processes is ultimately represented in binary, even though programmers usually work with more human-readable bases like decimal or hexadecimal.

Why is hexadecimal used instead of binary in programming?

Each hexadecimal digit represents exactly 4 binary digits (bits), so a hex number is about a quarter of the length of the equivalent binary number while representing the exact same value — much easier for a person to read, type, and compare than a long string of 1s and 0s.

Can this calculator handle negative numbers?

No — representing a negative number in binary or hexadecimal requires choosing a fixed bit-width and a two's-complement convention, which varies by context (8-bit, 16-bit, 32-bit, etc.). This calculator is scoped to non-negative whole numbers, where the conversion is unambiguous.