Number Base Converter

Convert numbers between binary, decimal, hexadecimal, and other bases.

Common conversions

BaseValue
Binary
Base 2
-
Octal
Base 8
-
Decimal
Base 10
-
Hexadecimal
Base 16
-
Base 32
Base 32
-

Converts whole numbers between any bases from 2 to 36 — binary, octal, decimal and hexadecimal included — and shows the common conversions side by side. Numbers of any length convert exactly.

How to use it

Set the input base, type the number, and choose the output base. The table below always shows binary, octal, decimal, hexadecimal and base 32, each with a copy button.

  • Uppercase output — letter digits as A–Z; on by default. Input may use either case.
  • Ignore spaces & underscores — accepts 1111 0000 or 1_000_000; on by default.
  • Group digits — spaces the output in groups of four (three for octal and decimal) for readability.

The input is a whole number, with an optional - or + sign; a negative number converts to a minus sign and the digits of its size. In bases 2, 8 and 16 the prefixes 0b, 0o and 0x are accepted; a prefix for another base names the base to switch to. Decimal points are not read.

How bases work

In base b, each digit counts b times as much as the one to its right. Bases above 10 use letters for digits beyond 9: A is 10, F is 15, Z is 35. Base 32 here is this positional numbering, with digits 0–9 and A–V; it is not the Base32 text encoding used for data.

Conversion uses arbitrary-precision integers, so very long numbers — 128-bit IDs, large hashes — convert without rounding.

Examples

A 64-bit hex value

Hexadecimal
FFFFFFFFFFFFFFFF
Decimal
18446744073709551615

Exact to the last digit — beyond the 16 significant digits a JavaScript number can hold.

Common values

Values that come up often, in the four common bases
DecimalBinaryOctalHexadecimal
0000
711177
10101012A
15111117F
161 00002010
100110 010014464
2551111 1111377FF
1024100 0000 00002000400
655351111 1111 1111 1111177777FFFF

See also