Decimal to binary converter with steps

Convert decimal to binary with repeated ÷2, fractions, and two’s complement steps.

Was this helpful?
Share Tool

13 in binary is 1101: divide by 2 and read the remainders bottom-up. This page converts one decimal at a time — signed or unsigned, Auto/8/16/32/64 bits, including repeating fractions — in this tab.

Need the reverse? Binary to decimal reads the same bits as a positional sum. To see decimal, binary, hex and octal together, use all bases at once in the binary converter.

Integer 13: 13÷2 remainder 1, 6÷2 remainder 0, 3÷2 remainder 1, 1÷2 remainder 1. Reading bottom-up gives 1101. Hex is D and octal is 15 on the secondary cards. Try 13 or 255 (11111111). An alternate method subtracts powers of two: 13 = 8+4+1, so bits 1101 again.

Negatives use two’s complement at the chosen width. −13 at 8 bits is 11110011: pad 13 to 00001101, invert to 11110010, add 1. Unsigned 8-bit 255 is 11111111; signed 8-bit cannot hold 255 and shows a red range error. 64-bit values use BigInt, so they stay exact past 2^53.

Fractions use repeated ×2. 10.625 is 1010.101 exactly (0.625 = 1/2 + 1/8). 0.1 cannot terminate: the widget prints 0.0(0011) = 0.0001100110011001... Open Step-by-step working for the ÷2 table, the ×2 table, and invert+1 on negatives. Close the tab when you are done — FlashKit does not store the number.

How to convert decimal to binary

  1. Type a decimal such as 13, 10.625 or −13. The binary card updates immediately; hex and octal appear beside it.
  2. Signed is the default. Unsigned accepts 255 in 8 bits. Pick Auto, 8, 16, 32 or 64 bits. Auto chooses the smallest width that fits.
  3. Open Step-by-step working for the remainder table (read bottom-up), the subtract-powers-of-2 method, and the fraction ×2 table.
  4. Copy any card. A red alert appears if the integer does not fit the width. Close the tab when you are done.

Key Features

  • Decimal → binary with hex and octal secondary results
  • Signed/unsigned and Auto/8/16/32/64-bit width, BigInt past 2^53
  • Fractions with repeating notation such as 0.0(0011)
  • Remainder table, subtract-powers-of-2, and invert+1 for negatives
  • Runs in this browser; nothing is uploaded

Repeated ÷2, and the subtract-powers method

  • 13 ÷ 2 = 6 remainder 1; 6 ÷ 2 = 3 remainder 0; 3 ÷ 2 = 1 remainder 1; 1 ÷ 2 = 0 remainder 1. The remainders bottom-up are 1101.
  • 255 is eight remainders of 1: 11111111. 1000 is 1111101000. Those rows are produced by the same engine as the widget.
  • Subtract powers of 2 as a check: 13 ≥ 8 so write 1 and subtract, 5 ≥ 4 so write 1, 1 < 2 so write 0, 1 ≥ 1 so write 1 → 1101.
  • Common mistake: reading remainders top-down (1011) instead of bottom-up (1101). Another: treating unprefixed 1000 as binary eight.

Fractions, negatives, and width

  • 10.625: integer 1010 from ÷2; fraction 0.625 × 2 = 1.25 → 1, 0.25 × 2 = 0.5 → 0, 0.5 × 2 = 1.0 → 1, so .101.
  • 0.1 repeats. The stored IEEE bit pattern is a different job — that is the IEEE 754 float converter.
  • −13 at 8 bits is 11110011. At 16 bits the same value is 1111111111110011. Width changes padding, not the invert+1 rule.
  • 8-bit unsigned max is 255; 8-bit signed max is 127. 256 needs 9 bits (100000000) or a wider Auto pick (16).

Common mistakes

  • Writing 13 as 1101 and then padding on the right (11010000) instead of the left (00001101) before invert+1.
  • Stopping the fraction ×2 loop when a remainder looks small — 0.1 never hits 0, so you must mark the repeating block.
  • Mixing the number 65 with the text “65”. Letters belong on the binary translator.
  • Assuming JavaScript Number is exact above 2^53. This page uses BigInt for the integer part.
  • Forgetting that Auto width will not warn on 300 in 8 bits because it silently steps up to 16.

Reference: 0–32, powers of two, and milestones

  • Rows are decimal, binary and hex from the shipped converter. 2^10 = 1024 is 10000000000. 65535 is sixteen 1s (FFFF).
DecimalBinaryHex
000
111
2102
3113
41004
51015
61106
71117
810008
910019
101010A
111011B
121100C
131101D
141110E
151111F
161000010
171000111
181001012
191001113
201010014
211010115
221011016
231011117
241100018
251100119
26110101A
27110111B
28111001C
29111011D
30111101E
31111111F
3210000020
64100000040
100110010064
12711111117F
1281000000080
25511111111FF
256100000000100
5121000000000200
100011111010003E8
102410000000000400

Frequently Asked Questions

What is 13 in binary?

1101. Divide 13 by 2 four times and read remainders 1,0,1,1 from the last remainder upward. Hex is D.

What is −13 in 8-bit two’s complement?

11110011. Pad 13 to 00001101, invert to 11110010, add 1. The unsigned readout of those bits is 243.

How is 10.625 written in binary?

1010.101. The integer 10 is 1010; 0.625 is 1/2 + 1/8, which is the fraction bits 101.

Why does 0.1 show 0.0(0011)?

1/10 is a repeating dyadic. The parentheses mark the period 0011 after a leading 0. IEEE-754 rounding is a separate page.

Does 255 fit in 8-bit signed mode?

No. Signed 8-bit max is 127. Switch to Unsigned, or let Auto pick 16 bits. 255 unsigned is 11111111.

Is this the same as the binary converter hub?

Same engine, one direction. The hub shows four bases in one box. This page is the remainder-table lesson for decimal → binary.

Expert Guide for Decimal to Binary Converter

View Blog
Two's Complement Explained: 8-Bit Examples

Two's Complement Explained: 8-Bit Examples

Learn two’s complement with 8-bit tables: −1, −5, −128 and 127. Invert+1 steps and a calculator that shows the range.

Read Guide

Categories

Browse all FlashKit tools