- All tools
- Number base converter
How do I convert a number between binary, decimal and hexadecimal?
Type a whole number into any of the binary, octal, decimal, hexadecimal or custom-base boxes and all the others update at once. It uses exact big-integer arithmetic, so even numbers with hundreds of digits convert without rounding, and negative numbers work too. Fractions and floating-point values are not supported; this page converts whole numbers only.
- Type or paste a whole number into any box, for example in decimal.
- Read the same number in the other bases, or choose your own base from 2 to 36.
- Pick a bit width to see the two’s-complement pattern, then copy what you need.
Fixed-width view (two’s complement)
What this page can do
- Convert between binary, octal, decimal and hexadecimal as you type
- Use any custom base from 2 to 36
- Exact results for very large integers, with no rounding
- Handle negative numbers and show two’s complement in 8, 16, 32 or 64 bits
- Group digits for readability and switch hex between upper and lower case
- Accept 0b, 0o and 0x prefixes and point to the exact invalid digit
When to use this page
- Reading a hex value from a debugger, memory dump or colour code as decimal or binary.
- Checking bit flags, masks and file permissions such as octal 755.
- Learning how positional number systems and two’s complement work.
When to use something else
- You need fractions or floating-point values such as 0.1 — this page converts whole numbers only.
- You want to turn text into binary or hex bytes — use a text or Base64 encoder instead.
- You need to convert a colour between HEX, RGB and HSL — use a colour converter.
How it compares with other options
A programmer’s calculator, the Python and JavaScript consoles, and the command line can all convert bases. JavaScript’s own Number type loses exact precision above 9,007,199,254,740,991, which is why many quick online converters give wrong answers for 64-bit values. This page uses BigInt, so large integers stay exact, and it updates every base while you type. It does not do arithmetic, fractions or floating-point formats.
Where your data goes
Nowhere. Everything is computed by your own browser. Nothing you type is sent to a server, logged or stored — close the tab and it is gone. You can check it yourself: open your browser’s network panel — the page still loads its own code and any ads, but no request carries what you typed.
Questions about this tool
How do I convert binary to decimal by hand?
Multiply each binary digit by a power of 2, counting from 0 on the right, and add the results. For example 1011 is 1×8 + 0×4 + 1×2 + 1×1 = 11. To go the other way, divide the decimal number by 2 repeatedly and read the remainders from last to first.
What is two’s complement and why does a negative number look different?
Computers store negative integers in a fixed number of bits using two’s complement: the pattern is the value counted back from 2 to the power of the width. For example −1 in 8 bits is 11111111 (hex FF) and −128 is 10000000. Choose a bit width on this page to see that pattern; the main fields show the signed form, such as −1010.
Can this convert fractions or floating-point numbers like 0.1?
No. This page converts whole numbers only. A value such as 0.1 or 1.5 is rejected with an explanation rather than silently rounded. Floating-point formats such as IEEE 754 store a sign, exponent and fraction, which is a different conversion that this page does not do.
How large a number can I convert?
There is no fixed size limit because the page uses the browser’s BigInt type. To keep the page responsive it accepts up to 5,000 digits per field. In the bit-width view, a value that does not fit in 8, 16, 32 or 64 bits is reported together with the range that does fit.