numvana

Number Base Converter (Decimal to Binary, Octal, Hex)

Convert a decimal integer into binary, octal, and hexadecimal, with its exact bit length and whether it's a power of two.

Binary
101010
Octal
52
Hexadecimal
2A
Bits needed
6
Power of two?
No

How it works

Converting a decimal integer to another base repeatedly divides it by that base and records each remainder, starting with the least significant digit — the standard division-remainder algorithm every base conversion uses. This calculator applies it to base 2 (binary), base 8 (octal), and base 16 (hexadecimal, where the digits 10-15 are written A-F).

Bit length is the number of binary digits the value needs (a byte holds 8 bits, so anything from 128-255 needs exactly 8). A value is a power of two exactly when its binary form has a single '1' digit — a useful thing to notice in computing, since powers of two mark clean boundaries like memory sizes and array capacities.

FAQ

Why can't I type a hexadecimal or binary number as the input?

This calculator only accepts a plain decimal number, since a numeric input field can't accept the letters A-F that hexadecimal needs. Decimal-to-other-base is the more common direction people need (e.g. 'what is 255 in hex'), so that's the direction this covers.

Is there a limit on how large a number I can convert?

Yes — up to Number.MAX_SAFE_INTEGER (9,007,199,254,740,991). Beyond that, floating-point numbers can't represent every integer exactly, so the conversion could silently be off by more than rounding error.

Related calculators