How to convert decimal to binary
Divide the number by 2 again and again, writing down each remainder (0 or 1), until you reach 0. Read the remainders from bottom to top. 182 → 91 r0 → 45 r1 → 22 r1 → 11 r0 → 5 r1 → 2 r1 → 1 r0 → 0 r1, so 182 = 1011 0110₂.
Related number conversions
How number bases work
A number base (radix) is how many different digits a system uses. In everyday decimal (base 10) each position is worth ten times the one to its right. Computers use binary (base 2, digits 0 and 1). Programmers also use hexadecimal (base 16, digits 0–9 and A–F) and octal (base 8) as compact ways to write binary: one hex digit is exactly 4 bits and one octal digit is 3 bits.
Converting to decimal
Multiply each digit by the base raised to its position (counting from 0 on the right) and add them up:
1011₂ = 1×2³ + 0×2² + 1×2¹ + 1×2⁰ = 8 + 0 + 2 + 1 = 11₁₀
Converting from decimal
Divide repeatedly by the new base and write the remainders from last to first. 11 ÷ 2 = 5 r 1, 5 ÷ 2 = 2 r 1, 2 ÷ 2 = 1 r 0, 1 ÷ 2 = 0 r 1, which reads as 1011.
| Decimal | Binary | Octal | Hex |
|---|---|---|---|
| 0 | 0000 | 0 | 0 |
| 1 | 0001 | 1 | 1 |
| 2 | 0010 | 2 | 2 |
| 4 | 0100 | 4 | 4 |
| 7 | 0111 | 7 | 7 |
| 8 | 1000 | 10 | 8 |
| 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 |
Roman numerals
Roman numerals use I = 1, V = 5, X = 10, L = 50, C = 100, D = 500 and M = 1000. A smaller numeral before a larger one is subtracted (IV = 4, IX = 9, XL = 40, XC = 90, CD = 400, CM = 900). Standard numerals run from 1 to 3,999. For example, 2026 = MMXXVI.
Frequently asked questions
How do I convert binary to decimal?
Write the place values 1, 2, 4, 8, 16… from right to left under the bits and add the place values where the bit is 1. For example, 1101 = 8 + 4 + 1 = 13.
How do I convert hexadecimal to binary?
Replace each hex digit with its 4-bit binary group: 3F = 0011 1111. To go back, group the bits in fours from the right.
Can this converter handle very large numbers?
Yes. Whole numbers of any length are converted exactly using arbitrary-precision arithmetic, so 64-bit values and larger are not rounded.
Does it support negative numbers?
Yes, a leading minus sign is kept, for example −1010₂ = −10. For two's complement (signed binary) values, see the 8, 16, 32 and 64-bit rows shown for negative decimals.