Loading...

Number Base Converter — Binary, Octal, Decimal & Hex Online

Convert numbers between binary, octal, decimal, and hexadecimal instantly, or use any custom base from 2 to 36. Type a value, pick the base it is currently written in, and all four common bases update live — each with its own copy button. The converter uses arbitrary-precision BigInt math under the hood, so huge integers convert exactly, with no floating-point rounding or precision loss. Negative numbers are supported with a leading minus sign, and invalid digits for the selected base are flagged immediately so you can spot typos before they cause a bad value.

Features

  • Four bases at once

    Binary, octal, decimal, and hexadecimal all recompute live as you type — no need to convert one at a time.

  • Arbitrary precision

    Conversion is done with BigInt, not parseInt/Number, so large integers stay exact instead of losing precision.

  • Custom bases 2-36

    Not limited to the common four — enter any base from binary up to base-36 for the source number.

  • Negative number support

    Prefix a value with `-` and the sign is preserved correctly across every output base.

  • Instant validation

    Characters that are not valid digits in the selected base are flagged with a clear inline error.

How to convert a number between bases

Convert any number to binary, octal, decimal, or hexadecimal in three steps.

  1. Choose the source baseSelect Binary, Octal, Decimal, Hexadecimal, or Custom (2-36) to match the base your number is currently written in.
  2. Type the numberEnter the digits, optionally prefixed with `-` for a negative value.
  3. Copy any resultAll four output bases update instantly — click Copy next to whichever one you need.

Examples

Decimal to other bases

Input
255 (Decimal)
Output
Binary 11111111, Octal 377, Hexadecimal FF

Hexadecimal to decimal

Input
1F4 (Hexadecimal)
Output
Decimal 500

Negative binary

Input
-1010 (Binary)
Output
Decimal -10, Octal -12, Hexadecimal -A

Frequently Asked Questions

What bases does this converter support?
The four common bases — binary (2), octal (8), decimal (10), and hexadecimal (16) — are shown as outputs simultaneously. As a source base you can also pick any custom base from 2 to 36.
Why use BigInt instead of parseInt?
JavaScript numbers lose precision above 2^53. parseInt and Number both convert through that limited numeric type, so very large integers get silently rounded. This tool parses digit-by-digit into a BigInt, keeping arbitrarily large integers exact.
Can I convert negative numbers?
Yes. Prefix the input with a minus sign (e.g. `-101`). The magnitude is converted normally and the sign is re-applied to every output base.
What happens if I enter an invalid digit?
The tool checks every character against the selected base and shows an inline error naming the first invalid character, for example entering `2` while Binary is selected.
How are letters used for bases above 10?
Letters extend the digit set past 9: `a` (or `A`) is 10, `b` is 11, and so on up to `z` for 35, which is why base-36 is the maximum supported.
Is my input sent to a server?
No. All parsing and conversion happens locally in your browser using JavaScript BigInt.