Number Base Converter
The Number Base Converter changes a whole number between binary, octal, decimal, hexadecimal and any base from 2 to 36 as you type. It handles numbers of any size, accepts 0x and 0b prefixes, and shows the bits needed and the two's complement pattern for negative numbers.
Type a whole number. Prefixes 0x, 0b and 0o work; spaces and underscores are ignored.
| Decimal (10) | – | |
|---|---|---|
| Binary (2) | – | |
| Octal (8) | – | |
| Hexadecimal (16) | – | |
| Base 36 | – |
Bits and two's complement
| Bits needed | – |
|---|---|
| Two's complement | – |
What is the Number Base Converter?
The Number Base Converter turns a whole number written in one base into all the common ones at once: decimal, binary, octal, hexadecimal and one more base of your choice up to 36. It works with very large numbers, such as 64-bit and 128-bit values, without rounding, because it uses exact big-integer maths. Paste values as you find them in code: 0xFF, 0b1010 and 0o755 are understood, and spaces and underscores are ignored. Binary is grouped in fours and decimal in threes for reading, and you can copy any result without the spaces. A bits section shows how many bits the number needs and its pattern in the smallest 8, 16, 32, 64 or 128-bit width, including two's complement for negative numbers. It is for programmers, computer science students, electronics hobbyists and network engineers.
Who it is for: Programmers and web developers, computer science and electronics students, embedded and hardware hobbyists, and network engineers reading masks and addresses.
How to use the Number Base Converter
- Type or paste the number.
- Choose the base it is written in: decimal, binary, octal, hex or another base.
- Read the number in every base in the table; type another base to see it too.
- Press Copy next to the one you need.
Why use it
- Every common base at onceDecimal, binary, octal, hex and one base of your choice, all updated as you type.
- No size limitExact big-integer maths, so 64-bit and larger values do not lose digits.
- Paste from code0x, 0b and 0o prefixes, spaces and underscores are accepted.
- Bits and two's complementSee the bits needed and the 8 to 128-bit pattern, including negatives.
At a glance
- What you put in
- A whole number, positive or negative, in base 2 to 36; prefixes 0x, 0b, 0o; optional second output base
- What you get
- Decimal, binary, octal, hexadecimal and one chosen base (2 to 36), grouped or plain; bits needed; 8, 16, 32, 64 or 128-bit two's complement pattern
- Limits
- Whole numbers only, no fractions; digits beyond 9 use letters a to z, so base 36 is the highest; two's complement shown up to 128 bits
- Privacy
- Runs in your browser. Nothing you enter is uploaded or stored.
- Price
- Free for everyone. No subscriptions, no payments, no watermark.
- Works offline
- Yes, once the page has loaded
- Last checked
- by AK Shine
Worked example
0x1F4, written in hexadecimal.
Decimal 500; binary 1 1111 0100; octal 764; hexadecimal 1f4; base 36 dw. Bits needed: 9 (highest bit is 2^8). 16-bit pattern: 0000 0001 1111 0100.
1F4 in hex is 1 × 256 + 15 × 16 + 4 × 1 = 500. In base 36, 500 = 13 × 36 + 32, and the digits 13 and 32 are written d and w.
When to use something else
- Fractions such as 0.1 are not converted; many decimal fractions have no exact binary form, which is why 0.1 + 0.2 is not exactly 0.3 in most programming languages.
- It does not convert text to binary or hex codes. For that, encode the text first with Base64 or a hash tool, or use your language's character functions.
- Floating point bit patterns (IEEE 754 single and double) are not shown.
Questions people ask
How do I convert decimal to binary?
Divide the number by 2 again and again and write down each remainder; read the remainders from last to first. 13 gives remainders 1, 0, 1, 1, so it is 1101. The converter does this for any size of number at once.
How do I convert hex to decimal?
Multiply each hex digit by 16 to the power of its place, counting from 0 on the right, and add. Letters a to f stand for 10 to 15. FF is 15 × 16 + 15 = 255. The tool shows this sum for smaller numbers.
Why do programmers use hexadecimal?
One hex digit is exactly four bits, so a byte is always two hex digits. That makes long binary values short and easy to read, as in colour codes like #FF8800, memory addresses and file headers.
What is two's complement?
It is how computers store negative whole numbers. In 8 bits, −1 is 1111 1111 and −42 is 1101 0110: take 2 to the power of the width and subtract the size of the number. The bits section shows the pattern for the smallest width that fits.
Can it convert very large numbers?
Yes. It uses exact big-integer maths, so numbers like 18446744073709551615 (the largest 64-bit unsigned value) convert without losing digits. Many calculators and JavaScript tools round numbers beyond 2^53.
What is base 36 used for?
Base 36 uses 0 to 9 and a to z, the most digits that fit in letters and numbers. It makes short IDs and codes, such as in URL shorteners and some tracking numbers. You can show any base from 2 to 36 in the extra row.
How do I read octal file permissions like 755?
Each octal digit is three bits for owner, group and others: read 4, write 2, run 1. 7 = 111 (read, write, run) and 5 = 101 (read, run). Convert 755 from octal and the binary row shows 111 101 101.