Number Base Converter

Enter an integer in binary, octal, decimal or hexadecimal and see it in all four bases at once, with the number of bits it needs.

Runs in your browser — nothing is uploaded

Binary (2)
Octal (8)
Decimal (10)
Hexadecimal (16)

Needs 8 bits as an unsigned value.

Conversion uses arbitrary-precision integers, so values far beyond 253 keep every digit. Fractions are not supported; convert the integer and fractional parts separately.

About the Number Base Converter

Positional number systems represent the same quantity with different digits. Computers store values in binary, programmers read memory addresses and colour codes in hexadecimal, and file permissions on Unix are written in octal. Converting between them is a daily task for anyone working close to the hardware or to protocols.

Input can be written with a prefix such as 0x for hex, 0b for binary or 0o for octal, and underscores are ignored, so 0xFF_FF and FFFF both work. The conversion uses arbitrary-precision integers, so values far larger than JavaScript’s safe integer limit keep every digit.

The bit count tells you how wide a field must be to store the value as an unsigned number. Negative numbers are shown with a minus sign, because their two’s-complement representation depends on the width you choose.

FAQ

Number Base Converter — frequently asked

How do I convert hexadecimal to decimal by hand?

Multiply each hex digit by a power of 16 based on its position from the right, then add the results. For 2A, that is 2 × 16 + 10 = 42, since A equals 10. Enter 2A with base 16 above to check your working.

Why do binary numbers get so long?

Each binary digit carries only one bit, so a number needs about 3.3 times as many binary digits as decimal digits. Hex compresses binary neatly because each hex digit stands for exactly four bits, which is why it is used for memory dumps and colours.

Can this converter handle fractions?

No, only integers. A fractional part converts differently, because repeated multiplication by the base produces the digits and some fractions repeat forever in one base but terminate in another.

What does the bit count mean?

It is the length of the binary representation without leading zeros, so 255 needs 8 bits and 256 needs 9. Choose a field width at least this large to store the unsigned value.

Why does a negative number show a minus sign?

Signed storage usually uses two’s complement, where the same bit pattern means different values depending on width. For example, -1 is all ones in any width. The converter shows the mathematical value rather than one fixed-width pattern.

Is my input sent anywhere?

No. The conversion runs in your browser, so the numbers you enter are not transmitted or stored.

    Report an issue