Binary, Hex & Octal Converter

Convert numbers between binary, decimal, hexadecimal, and octal bases. See all representations simultaneously as you type.

Runs in your browser. No data leaves your device.

About this tool

Converts a whole number between binary, octal, decimal and hexadecimal. Choose the base of your input, type the number, and all four representations appear at once, ready to copy with their 0b / 0o / 0x prefixes.

Features
  • Source base buttons: Binary (2), Octal (8), Decimal (10), Hexadecimal (16); switching base keeps the number (172 in Decimal becomes AC in Hex)
  • Spaces and underscores in the input are ignored (e.g. 1010_1100 or 1010 1100)
  • Binary output padded and grouped into 4-bit nibbles
  • Hexadecimal output in uppercase
  • Tap a row to copy it; copied values include the prefix (0b, 0o, 0x) with spaces removed. One Pipeline button sends the row tapped last (your input base until then)
  • Clear button and an inline error naming the first character that is not valid in the selected base (the whole input is checked, so "12z" is an error, not 12)
  • Arbitrary-size integers (BigInt), so long values stay exact
  • Negative numbers use a leading minus sign on every base (-1 -> binary -0001, copied as -0b0001)
How to use it
  1. Click the base your number is written in.
  2. Type or paste the number.
  3. Copy the binary, octal, decimal or hex result.
Inputs
  • An integer written in the selected base, with an optional leading - or + and an optional matching prefix (0b, 0o, 0x); case-insensitive hex digits
Outputs
  • Binary (nibble-grouped), octal, decimal and uppercase hex representations
Limits and notes
  • Whole numbers only; decimals such as 2.5 are rejected with an error
  • Negative numbers are shown as sign plus magnitude, not two's complement; there is no bit-width option
  • Nothing is saved; runs entirely in the browser

Frequently Asked Questions

How does the Number Base Converter work?

You choose the base your number is written in, then type it into the single input. The tool ignores spaces and underscores, accepts an optional leading - or + and a matching 0b, 0o or 0x prefix, and checks the whole input: a character that is not a valid digit in that base shows an error naming it. The value is read as a BigInt and written out in base 2, 8, 10 and 16, with binary grouped into 4-bit nibbles and hex in uppercase. Negative numbers get a leading minus sign rather than a two's complement form.

What number bases are supported?

Binary (base 2), octal (base 8), decimal (base 10), and hexadecimal (base 16). Pick the base of your input, and all four representations appear at once; tap a row to copy it with its 0b, 0o, or 0x prefix.

Why would I need to convert between number bases?

Programmers use binary and hexadecimal to work with memory addresses, color codes, file data, and hardware registers. Hex is a compact way to represent binary values -- each hex digit maps to exactly 4 binary bits.

Can I convert large numbers?

Yes, of any length. The tool uses JavaScript BigInt, so values far beyond 2^53 still convert exactly with no rounding. Only whole numbers are supported; a decimal such as 2.5 is rejected with an error.