What is 40 in binary?
40₁₀ converted to binary is 101000₂. The complete working for this exact number is below — or type a different number into the decimal to binary converter and watch it happen live.
Try it yourself — instant converter
See the steps for your number
How to convert 40 to binary, step by step
Keep dividing 40 by 2 and writing down each remainder. The remainders, read in reverse, are the answer.
| Number | ÷ 2 | Quotient | Remainder |
|---|---|---|---|
| 40 | 2 | 20 | 0 |
| 20 | 2 | 10 | 0 |
| 10 | 2 | 5 | 0 |
| 5 | 2 | 2 | 1 |
| 2 | 2 | 1 | 0 |
| 1 | 2 | 0 | 1 |
Reading the remainder column from the bottom up gives 101000, so 40₁₀ = 101000₂. Check it back: 32 + 8 = 40 — the 1 bits add up to 40.
In short: 40 ÷ 2 = 20 r 0 → 20 ÷ 2 = 10 r 0 → 10 ÷ 2 = 5 r 0 → 5 ÷ 2 = 2 r 1 → 2 ÷ 2 = 1 r 0 → 1 ÷ 2 = 0 r 1 → read bottom-up: 101000₂
Frequently asked questions
How do you write 40 in binary?
Divide 40 by 2 over and over, noting each remainder: 40 ÷ 2 = 20 r0, 20 ÷ 2 = 10 r0, 10 ÷ 2 = 5 r0, 5 ÷ 2 = 2 r1, 2 ÷ 2 = 1 r0, 1 ÷ 2 = 0 r1. Reading the remainders from last to first gives 101000, so 40₁₀ = 101000₂.
How long is 40 in binary?
40 in binary is 101000, which is 6 bits long. It ends in 0 because 40 is even — the last bit of any binary number tells you odd (1) or even (0).
Keep converting
← 39 in binary · 41 in binary →
Popular values
10 in binary · 25 in binary · 42 in binary · 50 in binary · 100 in binary · 255 in binary