Decimal to Binary Converter
Convert decimal numbers to binary online and see the division by 2 step by step. Supports fractions, 8, 16, 32 and 64-bit two's complement and bulk lists.
Runs in your browser · Nothing uploaded · No sign-up
Something not working, or missing a feature? Send feedback
About the Decimal to Binary Converter
The Decimal to Binary Converter writes any decimal number in base 2 and shows the classic method: divide by 2 again and again and read the remainders from the bottom up. Choose an 8, 16, 32 or 64-bit width to pad the result or to see negative numbers in two's complement, as a CPU stores them.
Conversion happens in your browser, so your files and records stay private.
How to use the Decimal to Binary Converter
- Type a decimal number such as 156, or paste a list with one number per line.
- Pick a bit width if you need padding or two's complement for negative numbers; leave Auto otherwise.
- Read the binary result and the division table that produced it.
- Turn on "Group by 4 bits" for easier reading, then copy the result.
Decimal 0–16 in binary
| Decimal | Binary | 8-bit |
|---|---|---|
| 0 | 0 | 00000000 |
| 1 | 1 | 00000001 |
| 2 | 10 | 00000010 |
| 3 | 11 | 00000011 |
| 4 | 100 | 00000100 |
| 5 | 101 | 00000101 |
| 6 | 110 | 00000110 |
| 7 | 111 | 00000111 |
| 8 | 1000 | 00001000 |
| 9 | 1001 | 00001001 |
| 10 | 1010 | 00001010 |
| 11 | 1011 | 00001011 |
| 12 | 1100 | 00001100 |
| 13 | 1101 | 00001101 |
| 14 | 1110 | 00001110 |
| 15 | 1111 | 00001111 |
| 16 | 10000 | 00010000 |
Examples
Input
156
Result
10011100
156 ÷ 2 = 78 r0, 78 ÷ 2 = 39 r0, 39 → r1, 19 → r1, 9 → r1, 4 → r0, 2 → r0, 1 → r1; read upwards.
Input
-5 (Bit width 8-bit)
Result
11111011
Input
0.1
Result
0.00011001100110011001100110011001…
The … marks a fraction cut off after 32 binary digits.
Input
1000 (Group by 4 bits)
Result
11 1110 1000
Common mistakes
- Reading the remainders top-down. The first remainder is the lowest bit. Reading the division table from the top gives the bits in reverse.
- Expecting exact decimal fractions. Most decimal fractions repeat in binary. Store money in whole cents (integers) instead of binary floating point.
Works well with the Decimal to Binary Converter
- Binary to Decimal Converter: check the result by converting it back.
- Decimal to Hex Converter: get the same value in hexadecimal.
- Text to Binary: turn text, not numbers, into bytes of binary.
Frequently asked questions
How do you convert decimal to binary?
Divide the number by 2 and write down the remainder (0 or 1). Repeat with the quotient until it is 0. The remainders read from the last to the first are the binary digits: 156 gives 10011100.
How are negative numbers written in binary?
Computers use two's complement. For −5 in 8 bits, take 2⁸ − 5 = 251, which is 11111011. Pick a bit width so the converter knows how many bits to use; with Auto it writes −101 with a minus sign.
Why does 0.1 never end in binary?
0.1 is 1/10, and 10 has the factor 5, which powers of 2 cannot divide. The digits repeat forever (0.000110011…), so the converter stops after 32 digits and marks the result with …. This is also why 0.1 + 0.2 is not exactly 0.3 in floating point.
What range fits in each width?
8 bits hold 0 to 255 unsigned or −128 to 127 signed; 16 bits 0 to 65,535 or −32,768 to 32,767; 32 bits up to 4,294,967,295 or −2,147,483,648 to 2,147,483,647. The converter tells you when a value does not fit.
Related tools
JSON to CSV
Convert JSON arrays to CSV online with automatic column detection, nested object flattening and custom delimiters. Open the result in Excel or Sheets.
CSV to JSON
Convert CSV to a JSON array online with header detection, type inference and delimiter auto-detection. Turn spreadsheet exports into data for APIs and code.
JSON to XML
Convert JSON to well-formed XML online with a configurable root element and attribute support. Validate the input and download the XML file.
XML to JSON
Convert XML to JSON online, keeping attributes and turning repeated elements into arrays. Malformed XML is reported with its location.
JSON to YAML
Convert JSON to clean, human-readable YAML online. Turn API responses and package files into config for Kubernetes, Docker Compose or CI pipelines.
YAML to JSON
Convert YAML documents to formatted JSON online with syntax validation. Errors are reported by line, so broken indentation is quick to find and fix.