Number Base Converter
Convert numbers between binary, decimal, hexadecimal, and other bases.
Common conversions
| Base | Value | |
|---|---|---|
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 0000or1_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
| Decimal | Binary | Octal | Hexadecimal |
|---|---|---|---|
0 | 0 | 0 | 0 |
7 | 111 | 7 | 7 |
10 | 1010 | 12 | A |
15 | 1111 | 17 | F |
16 | 1 0000 | 20 | 10 |
100 | 110 0100 | 144 | 64 |
255 | 1111 1111 | 377 | FF |
1024 | 100 0000 0000 | 2000 | 400 |
65535 | 1111 1111 1111 1111 | 177777 | FFFF |
See also
- Hash Generator — for hexadecimal hashes of text.
- Text to Binary Converter — for text as binary, hex or decimal bytes, in UTF-8.