Decimal to Binary Converter

Convert any whole number to binary, grouped for readability.

Free decimal to binary converter — enter a base-10 number and get the base-2 binary representation, neatly grouped into nibbles, plus hex and octal. Runs entirely in your browser, nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

How does decimal to binary conversion work?

Each binary digit represents a power of two. The number is repeatedly divided by two and the remainders, read bottom to top, form the binary value — for example 13 becomes 1101.

Decimal to binary — base-10 to base-2

Enter a whole number and this tool returns its binary (base 2) representation, neatly grouped into 4-bit nibbles, plus the hexadecimal and octal forms alongside. It is useful for programmers working with bitmasks or bit flags, students studying number systems, and anyone who needs to understand how a decimal value maps to raw binary storage.

How it works

Binary is a base-2 system where each position represents a successive power of two, doubling left to right from the least-significant bit:

Position (right to left):   7    6    5    4    3    2    1    0
Power of two:               128   64   32   16    8    4    2    1

To convert a decimal number to binary, divide it repeatedly by 2 and record the remainders. Reading those remainders from bottom to top gives the binary digits. Alternatively, find the largest power of two that fits, subtract it, then repeat — the positions used correspond to the bits that are set to 1.

The tool pads the result to a multiple of 4 bits and groups it into nibbles (4-bit groups). Each nibble maps to exactly one hexadecimal digit, which is why 8-bit binary is always two hex digits and 16-bit binary is always four.

Step-by-step: converting 173

173 ÷ 2 = 86 remainder 1 86 ÷ 2 = 43 remainder 0 43 ÷ 2 = 21 remainder 1 21 ÷ 2 = 10 remainder 1 10 ÷ 2 = 5 remainder 0 5 ÷ 2 = 2 remainder 1 2 ÷ 2 = 1 remainder 0 1 ÷ 2 = 0 remainder 1

Reading remainders bottom-to-top: 10101101 — grouped into nibbles: 1010 1101

You can verify by summing the set bits: 128 + 32 + 8 + 4 + 1 = 173. ✓

BaseValue
Decimal (10)173
Binary (2)1010 1101
Hex (16)AD
Octal (8)255

Where decimal-to-binary conversion comes up in practice

  • Bitmasks and flags: storing multiple boolean states in a single integer, where each bit is one flag. Checking whether bit 3 is set means testing if the binary value has a 1 in the 2³ position.
  • Colour values: RGB colours are often represented as three 8-bit binary numbers (0–255 each), and understanding the binary form helps when working with bitwise AND/OR operations on packed colour values.
  • Networking: IP subnet masks like 255.255.255.0 are stored and manipulated as 32-bit binary values.
  • Low-level programming: assembly language, embedded systems, and hardware registers are all described in binary or hexadecimal.

The conversion runs entirely in your browser — nothing is uploaded.