Skip to main content
Back to Developer Tools

Number Base Converter

Convert numbers between binary, octal, decimal, and hexadecimal bases

Number Base Conversion
Enter a number in any base and see its conversion to other bases
Quick Conversion
Conversion History

No conversion records

Related Tools
Number base conversion formula
A number in any base is the sum of each digit multiplied by its positional weight.
Decimal value = Σ(digit × base^position)
Example: 1011₂ = 1×2^3 + 0×2^2 + 1×2^1 + 1×2^0 = 11₁₀
Decimal to target base = repeated division by target base, read remainders in reverse
digit
Single symbol in the source base
For base 16, valid digits are 0-9 and A-F.
base
Radix
The count of symbols used by the number system, such as 2, 8, 10, or 16.
position
Power index
Positions are counted from right to left starting at zero.
How this number base converter works
The converter validates input digits for the selected base, converts to decimal, then formats the same value in binary, octal, decimal, and hexadecimal.
  1. Validate the input against the selected source base.
  2. Parse the input into a decimal integer using positional notation.
  3. Convert that decimal value into binary, octal, decimal, and hexadecimal strings.
  4. Group binary and hexadecimal output for easier reading.
  5. Keep recent conversions in local page state for quick comparison.

Important notes

  • This page handles integer conversions, not floating-point binary representation.
  • Very large integers may exceed JavaScript number precision and should be handled with a BigInt-specific tool.
  • Signed integers, two's complement, byte order, and fixed-width overflow are separate representation questions.
Number base examples
These examples cover common developer use cases for binary, decimal, and hexadecimal conversion.

Binary permissions bitmask

Inspect a small bitmask value from a flag field.

  • Input: 13
  • Source base: decimal

Binary: 1101

The set bits are 8, 4, and 1, which often map to enabled flags.

Hex color channel

Convert a decimal byte value to hexadecimal.

  • Input: 255
  • Source base: decimal

Hexadecimal: FF

One byte maps cleanly to two hexadecimal digits.

Network-related binary check

Understand why 192 appears as C0 in IPv4 hex notation.

  • Input: 192
  • Source base: decimal

Binary: 11000000, hexadecimal: C0

Binary and hex views are often easier for subnet masks and byte-level debugging.

Number base FAQ
Common boundaries for integer conversion and binary representation.