Number Base Converter

Base 2

11111111

Base 8

377

Base 10

255

Base 16

FF

About Number Base Converter

Paste a number in binary, octal, decimal or hexadecimal and see the same integer in all four bases.

Programmers, networking docs and low-level tools often switch between decimal, binary and hexadecimal. This converter uses BigInt instead of floating-point math, so large integer values stay exact.

The input is validated for the selected base, and all conversion happens locally.

A worked example

The decimal number 255 is FF in hexadecimal, 377 in octal and 11111111 in binary. Type any one of those with the matching input base selected and the other three appear. Larger values work the same way: 2 to the power of 64, which is 18446744073709551616, converts to 10000000000000000 in hexadecimal (a 1 followed by sixteen zeros) — a value an ordinary JavaScript number would silently round.

What you can paste

You can paste a value the way it appears in code: 0xFF, #FF, 0b1010 and 0o17 are accepted when the matching input base is chosen. Spaces and underscores are treated as digit separators, so 1010_1010 or ff ff work, and a leading minus sign is kept. Hexadecimal output is shown in capitals.

If the prefix names a different base from the one selected — 0xFF while Base 2 is chosen — you get a message saying which base to pick rather than a wrong answer. Fractions and decimal points are not supported: this converts whole integers only.

Reading file permissions and colours

A Unix permission such as 755 is octal: each digit is three bits, so 7 is 111 (read, write, execute), 5 is 101 (read and execute), and 755 is 111 101 101 in binary. Converting 755 from octal to binary shows that directly. A colour like #FF8800 is three hexadecimal bytes: FF, 88 and 00 are 255, 136 and 0 in decimal — convert each pair separately to get the red, green and blue values.

Common mistakes

The usual error is leaving the input base on decimal while typing a hex value: 1F is not valid decimal and is rejected with a message. Another is expecting a fixed width — binary output has no leading zeros, so 5 shows as 101, not 00000101. Pad it yourself if you need a specific bit width.

What you can use it for

  • Convert hexadecimal color or memory values to decimal
  • Read a binary flag value as decimal
  • Check octal file permission values
  • Convert large integer IDs without losing precision

How it works, step by step

  1. 1

    Enter a number

    Paste the value you want to convert.

  2. 2

    Pick input base

    Choose binary, octal, decimal or hexadecimal.

  3. 3

    Read outputs

    All other bases update instantly.

  4. 4

    Copy result

    Copy whichever base you need.

Frequently asked questions

Can it handle very large numbers?

Yes. It uses BigInt, so integer conversion is exact beyond JavaScript's normal safe-number limit.

Why is my binary value rejected?

Binary can only contain 0 and 1. Pick the correct input base if your value contains other digits.