Yes, you can convert any decimal number to binary instantly. Type your number into a free converter and get the binary result in real time. No signup, no app install, no manual math required.
But if you are a student, developer, or just curious, you should also understand how the conversion works. This guide covers both: the fast way (use the tool) and the manual way (the division method).
You also get the octal and hexadecimal equivalents at the same time, plus the bit length.
Convert decimal to binary, hex, and octal at once.
Open Converter →The method is called repeated division by 2.
Convert 42 to binary:
Read the remainders from bottom to top: 101010. That is 42 in binary.
Verify: 1×32 + 0×16 + 1×8 + 0×4 + 1×2 + 0×1 = 32 + 8 + 2 = 42. Correct.
| Decimal | Binary | Bits | Notes |
|---|---|---|---|
| 0 | 0 | 1 | Zero in any base |
| 1 | 1 | 1 | Simplest conversion |
| 10 | 1010 | 4 | Not 10 in binary |
| 25 | 11001 | 5 | |
| 42 | 101010 | 6 | The answer to everything |
| 100 | 1100100 | 7 | Needs 7 bits, not 3 |
| 127 | 1111111 | 7 | Max 7-bit unsigned value |
| 128 | 10000000 | 8 | First number needing 8 bits |
| 255 | 11111111 | 8 | Max value of one byte |
| 256 | 100000000 | 9 | First 9-bit number |
| 1000 | 1111101000 | 10 | |
| 1024 | 10000000000 | 11 | 2 to the power of 10 |
| 65535 | 1111111111111111 | 16 | Max 16-bit unsigned |
Instead of dividing, subtract powers of 2 from left to right. Faster for numbers under 256.
Powers of 2: 128, 64, 32, 16, 8, 4, 2, 1
Example: convert 173 to binary.
Result: 10101101. Done in 8 checks.
Use DEC2BIN() in both Excel and Google Sheets. But it only handles numbers up to 511. For numbers above 511, open the Number Base Converter which handles numbers up to 9 quadrillion.
bin(42) returns '0b101010'Integer.toBinaryString(42) returns "101010"(42).toString(2) returns "101010"std::bitset<8>(42).to_string() returns "00101010"Our converter shows binary, octal, decimal, and hexadecimal simultaneously. If you work with Base64 encoding or need to check hash values, having a number converter bookmarked saves time weekly.
For color work, the Color Picker converts RGB to hex automatically.