Binary Converter: Convert a Whole Number to Binary, Decimal, Octal and Hex
What this tool does
Computers write numbers in binary (base 2, digits 0 and 1). People usually use decimal (base 10). Programmers also use octal (base 8) and hexadecimal (base 16, digits 0 to 9 and A to F). This tool takes a whole number in one of these four systems and shows it in all four.
The calculation uses exact whole-number arithmetic, so very large numbers are not rounded. A leading minus sign is kept, and a 0b, 0o or 0x prefix is accepted when it matches the chosen system. Fractions are not supported: a decimal point gives an error. For other bases, from 2 to 36, use the Base Converter tool on this site.
The page code runs in your browser and loads no extra library.
📌 How to use
- Type the number.
- Choose the system it is written in.
- Press Convert and read all four forms.
✨ Features
🔍 Related search terms
Binary Converter: inputs, output and examples
This tool works on numbers and bytes in your browser. The page code runs in your browser and loads no extra library.
Inputs and output
- Input: a whole number and the system it is written in.
- Output: the same number in binary, decimal, octal and hexadecimal, or a message that names the problem.
Worked examples
Decimal 255 gives binary 11111111, octal 377 and hexadecimal FF. Binary 1010 gives decimal 10, octal 12 and hexadecimal A. Hexadecimal ff written as 0xff also works. The decimal number 18446744073709551616 gives hexadecimal 10000000000000000 with no rounding. Binary 102 is an error, because 2 is not a binary digit.
How to use it
- Type the number.
- Choose the system it is written in.
- Press Convert and read all four forms.
Common mistakes
- Wrong system selected. 11 means three in binary but eleven in decimal. Check the "Written in" choice.
- Fractions. 3.5 gives an error. Only whole numbers are converted.
- Digits outside the system. 8 is not valid in octal and 2 is not valid in binary.
Limits
Whole numbers only, up to 2000 digits. No fractions and no fixed-width two's complement: a negative number is shown with a minus sign. The counter counts successful conversions in this browser only.
Frequently Asked Questions
How do I convert decimal to binary?
Choose Decimal, type the number and press Convert. The binary form is shown first.
How do I convert binary to decimal?
Choose Binary, type the digits and press Convert. The decimal form is in the second box.
Is it exact for big numbers?
Yes, the tool uses exact whole-number arithmetic for numbers up to 2000 digits.
How are negative numbers shown?
With a minus sign, for example -5 is -101 in binary. It does not show two's complement bits.
Why do I get an error?
A character is not a valid digit for the chosen system, or the text has a decimal point or other symbol.
Can it convert fractions?
No, only whole numbers.
Can I use bases other than 2, 8, 10 and 16?
Use the Base Converter tool on this site for any base from 2 to 36.
Is my input uploaded?
The page code does not upload it. The conversion happens in your browser.