# Decimal to binary: repeated division, padding to 8 bits and the 0 to 255 limit

> How to turn an everyday number into binary by hand, a table of examples checked with the converter, and what the tool does with commas, minus signs and numbers above 255.

- Tool: [Decimal to Binary Converter](https://toolsg.com/en/decimal-to-binary)
- Language: en (available: en, zh, ms, ta)
- Last verified against official sources: 2026-10-18
- Source site: ToolSG — a planning guide, not official or financial advice. Cite the agencies listed under Sources.

## Key figures at a glance

| Fact | Value | Source |
| --- | --- | --- |
| Accepted range per number | 0 to 255 — Each number is treated as one byte. 256 or more is rejected as out of range. |  |
| Output width | Always 8 digits per number — Short results are padded with leading zeros, so 5 appears as 00000101. |  |
| Commas, hyphens and underscores | Act as separators, not as part of the number — 1,000 is read as the two numbers 1 and 0; -5 is read as 5. |  |
| Same conversion in JavaScript | `(202).toString(2)` returns "11001010" — toString does not pad, so 5 would give "101". | [MDN Number.prototype.toString](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) |

## Converting a decimal number by repeated division

Shown for 202; the method works for any whole number.

1. **Divide by 2 and note the remainder** — 202 / 2 = 101 remainder 0. The remainder is always 0 or 1.
2. **Keep dividing the quotient until it reaches 0** — The quotients 101, 50, 25, 12, 6, 3, 1, 0 come with the remainders 0, 1, 0, 1, 0, 0, 1, 1.
3. **Read the remainders from last to first** — Bottom to top, the remainders spell 11001010.
4. **Pad to 8 digits if you want a full byte** — 202 already has 8 digits; 42 becomes 00101010. The converter does this padding for you. Tools: [Decimal to Binary Converter](https://toolsg.com/en/decimal-to-binary)

## Why repeated division works

A decimal number is a sum of powers of two. Dividing by 2 peels off the smallest power first: the remainder tells you whether the 1s place is switched on, the quotient is what is left for the 2s, 4s, 8s and so on. That is why the remainders come out from the right-hand digit of the binary number to the left-hand one, and why you read them back in reverse.

An alternative is to subtract the largest power of two that fits: 202 - 128 = 74, 74 - 64 = 10, 10 - 8 = 2, 2 - 2 = 0, which switches on 128, 64, 8 and 2 and gives `11001010`.

## Worked examples

| Decimal | Binary (8 bits) | Which weights are on |
| --- | --- | --- |
| 5 | `00000101` | 4 + 1 |
| 42 | `00101010` | 32 + 8 + 2 |
| 65 | `01000001` | 64 + 1 |
| 100 | `01100100` | 64 + 32 + 4 |
| 128 | `10000000` | 128 |
| 200 | `11001000` | 128 + 64 + 8 |
| 202 | `11001010` | 128 + 64 + 8 + 2 |
| 255 | `11111111` | all eight |

Every row came from running the converter's code. Several numbers can be entered at once: `72 105` gives `01001000 01101001`.

## How the converter treats your input

- **Leading zeros are fine.** `007` is read as 7 and shown as `00000111`.
- **256 and above are rejected.** The tool works on bytes, so it cannot show 300 or 1000 as one binary number. Split the number, or use the division method by hand for larger values.
- **Fractions are rejected.** `3.5` is not a valid decimal token for this tool.
- **Separators are broad.** Spaces, commas, semicolons, colons, underscores and hyphens all split numbers.

## Common mistakes

- **Typing thousands separators.** `1,000` becomes the two numbers 1 and 0, giving `00000001 00000000`, not 1000 in binary.
- **Typing a negative number.** The minus sign is treated as a separator and dropped, so `-5` gives the same result as `5`: `00000101`. The converter does not produce two's complement. If you need -5 as a signed 8-bit value, work out 256 - 5 = 251 and convert that instead; `251` gives `11111011`.
- **Reading the remainders top to bottom.** The first remainder is the last binary digit.
- **Counting the padding as part of the value.** The leading zeros only fill the byte; `00000101` and `101` are both 5.

> **Tip:** To check your own division, convert back with [binary to decimal](https://toolsg.com/en/binary-to-decimal). If the round trip returns your starting number, the working was right.

## Related tools

- [Binary to decimal](https://toolsg.com/en/binary-to-decimal) is the reverse direction.
- [Decimal to hex](https://toolsg.com/en/decimal-to-hex) writes the same byte with two digits.
- [Decimal to octal](https://toolsg.com/en/decimal-to-octal) writes it with three.
- [Text to binary](https://toolsg.com/en/text-to-binary) converts characters rather than numbers.

## Frequently asked questions

**Is my data sent anywhere?**

No. The conversion runs entirely in your browser using JavaScript. Nothing you paste leaves your device, is logged, or is stored.

**How should I separate values?**

Spaces work, and so do commas, colons and semicolons. For binary, hex and octal you can also paste a single unbroken run of digits — it is split into bytes automatically.

**Does it handle emoji and non-English text?**

Yes. Text is treated as UTF-8, so accented characters, Chinese, Tamil and emoji all convert correctly. They simply take more than one byte each.

**Why did I get an error?**

The input contained a character that is not valid for the source format, a value above 255, or a run of digits that does not divide evenly into bytes. The message names the specific token so you can find it.


## Sources

- [MDN: Number.prototype.toString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toString) — toString(2) gives the binary digits of a Number; negative numbers keep a minus sign rather than using two's complement.
- [MDN: parseInt()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt)
