RYU Tools

Number Base Converter

Convert whole numbers between binary, octal, decimal and hexadecimal, with all four bases shown at once.

Convert a whole number

Negative values are supported. A 0b, 0o or 0x prefix is accepted and removed.

Spaces and underscores between digits are ignored.

Every base is shown beside the result, each with its own copy button.

Value in Hexadecimal

FF

Base 16, written with the 0x prefix in code

In every base

The same value written in all four bases.

Binary

Grouped: 1111 1111

11111111 (base 2)

Octal

377 (base 8)

Decimal

255 (base 10)

Hexadecimal

FF (base 16)

Bits needed

In binary

8

Digits in this base

As you typed it, without a prefix

3

How it is calculated

Binary  = base 2   (0 and 1)
Octal   = base 8   (0 to 7)
Decimal = base 10  (0 to 9)
Hex     = base 16  (0 to 9 and A to F)

Conversion is done with BigInt, so long values keep every digit instead of losing the end to rounding.

How to use Number Base Converter

  1. 1Type a whole number - a 0b, 0o or 0x prefix is accepted and removed.
  2. 2Choose the base the number is written in, and the base you want it in.
  3. 3Read the converted value, then every other base beside it.
  4. 4Press the copy button beside any base to take that value.

Frequently asked questions

How long a number can I convert?

Up to 200 digits. Conversion uses BigInt, so every digit is kept exactly instead of the end of a long binary number drifting through floating point rounding.

Are negative numbers supported?

Yes, with a minus sign in front. Binary, octal and hexadecimal are written with the sign outside the digits rather than as a two's complement pattern, which is what most calculators do.

Related tools

More calculators you might find useful.

RYU Tools keeps your work on your own device: no advertising, no third-party tracking and no account. The site only uses the small amount of browser storage needed to work - including remembering this acknowledgement and any accessibility settings you choose. Details are in our Privacy Policy.

Read the policy