Skip to content

Number Base Converter

Converts between binary, octal, decimal, hexadecimal and any base up to 36, with bitwise views.

Type a number in one base and read it in binary, octal, decimal and hex at once, plus any base up to 36. The bitwise view underneath shows the actual bit pattern, which is what you usually came for when the number is a flag field or a permission mask.

🔒 Runs entirely in your browserbasebinaryhexconvert

Fractions are supported: 1010.101 in binary, 1A.8 in hex. Spaces and underscores are ignored.

32

Converted

  • Binary11111111
  • Octal377
  • Decimal255
  • Hexadecimalff
  • Base 3673
  • Base 7513

Digits in brackets repeat forever. Every rational number either terminates or repeats in every base — 0.1 in base 10 is exact, in base 2 it is 0.0(0011).

Bit view

Two’s complement at common widths
WidthBits
8-bitdoes not fit in 8 bits
16-bit0000 0000 1111 1111
32-bit0000 0000 0000 0000 0000 0000 1111 1111
64-bit0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 1111 1111

Two’s complement, the representation a CPU actually uses.

Round trip check: 255 back in base 10.

How to use it

  1. Say what base you are typing in

    The same digits mean different numbers in different bases: 101 is one hundred and one in decimal and five in binary. Getting this wrong is the only way to get a wrong answer here.

  2. Type the number

    Hex letters can be upper or lower case. A digit that does not exist in the chosen base — an 8 in octal, say — is reported rather than silently dropped.

  3. Read the bit view for masks and flags

    It labels the bit positions, so you can see at a glance that 0o755 has the owner-write bit set and the group-write bit clear without counting on your fingers.

Common questions

What is the largest number it handles?

Conversion is done on exact integers rather than doubles, so numbers past 2^53 keep every digit. A 64-bit hex value round-trips exactly instead of arriving with its last few digits rounded off.

Why does base 36 stop there?

Because there are ten digits and twenty-six letters, and after that there is no agreed alphabet. Base 62 and base 64 exist but each has several incompatible orderings, so a converter that offered them would have to guess which one you meant.

How do I read a negative number in binary?

A minus sign is shown rather than a two’s-complement pattern, because two’s complement only means something once you fix a width. If you need the 32-bit pattern for −1, add 2^32 to it first.

Feed it from

Next

These accept what this tool produces, so the result can go straight in.