Decimal to Binary Calculator — With Steps
Binary Value
--
Division Steps
--
Hexadecimal
--
Octal
--
How Decimal to Binary Conversion Works
Decimal to binary conversion is the process of translating a base-10 number into its base-2 equivalent, which uses only the digits 0 and 1. Binary is the fundamental language of all digital computers because electronic circuits operate in two states: on (1) and off (0). According to the IEEE 754 standard, all floating-point arithmetic in modern processors is performed in binary, making this conversion essential for anyone working in computer science, electrical engineering, or digital logic design.
The most common method is repeated division by 2, also called the division-remainder method. You divide the decimal number by 2, record the remainder, then divide the quotient by 2 again, continuing until the quotient reaches 0. The binary result is the remainders read in reverse order (bottom to top). This calculator performs the conversion instantly and also displays the hexadecimal and octal equivalents, which programmers use as shorthand for binary. You can reverse the process with our Binary to Decimal Calculator, or explore other number systems with the Hex Calculator.
The Division-Remainder Method
The standard algorithm for converting decimal to binary is based on the positional value system. Each binary digit (bit) represents a power of 2, starting from 2^0 = 1 at the rightmost position:
Divide the decimal number by 2 repeatedly. Record each remainder (0 or 1). Read the remainders from last to first.
- Dividend: The number being divided at each step, starting with the original decimal value.
- Quotient: The result of each division, which becomes the next dividend.
- Remainder: Either 0 or 1 at each step — this becomes the corresponding binary digit.
Worked example: Convert 214 to binary. 214 / 2 = 107 remainder 0; 107 / 2 = 53 remainder 1; 53 / 2 = 26 remainder 1; 26 / 2 = 13 remainder 0; 13 / 2 = 6 remainder 1; 6 / 2 = 3 remainder 0; 3 / 2 = 1 remainder 1; 1 / 2 = 0 remainder 1. Reading remainders bottom-up: 11010110. Verification: 128 + 64 + 16 + 4 + 2 = 214.
Key Terms You Should Know
Bit (binary digit) — the smallest unit of data in computing, representing a single 0 or 1. Eight bits form one byte, which can represent values from 0 to 255 (decimal). The term "bit" was coined by mathematician John Tukey in 1947.
Byte — a group of 8 bits, capable of storing 2^8 = 256 different values. One byte can represent a single ASCII character (e.g., the letter "A" is 01000001 in binary, or 65 in decimal).
Hexadecimal (base-16) — a number system using digits 0-9 and letters A-F. Each hex digit maps exactly to 4 binary bits, making it a compact way to express binary values. The color code #FF0000 (red) equals 11111111 00000000 00000000 in binary.
Octal (base-8) — a number system using digits 0-7, where each digit represents 3 binary bits. Octal is used in Unix/Linux file permissions (e.g., chmod 755 means rwxr-xr-x). Use our Number Base Converter to work with all bases.
Two's complement — the standard method for representing signed (positive and negative) integers in binary. To get the negative of a number, flip all bits and add 1. In 8-bit two's complement, -1 is 11111111 and -128 is 10000000.
Decimal, Binary, Hexadecimal, and Octal Comparison
The following table shows key decimal values alongside their binary, hexadecimal, and octal equivalents. These values appear frequently in computing — for instance, 255 is the maximum value of a single byte, and 65,535 is the maximum for an unsigned 16-bit integer. Data sourced from the National Institute of Standards and Technology (NIST) digital data reference.
| Decimal | Binary | Hexadecimal | Octal | Significance |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | Zero / null / false |
| 1 | 1 | 1 | 1 | True / unit value |
| 10 | 1010 | A | 12 | Common test value |
| 127 | 1111111 | 7F | 177 | Max signed 8-bit int |
| 255 | 11111111 | FF | 377 | Max unsigned byte |
| 1024 | 10000000000 | 400 | 2000 | 1 kilobyte (KiB) |
| 65535 | 1111111111111111 | FFFF | 177777 | Max unsigned 16-bit |
Practical Examples
Example 1 — IP address conversion: The IP address 192.168.1.1 consists of four octets in decimal. Converting each: 192 = 11000000, 168 = 10101000, 1 = 00000001, 1 = 00000001. The full 32-bit binary is 11000000.10101000.00000001.00000001. Network engineers use binary to understand subnet masks and CIDR notation.
Example 2 — Color codes in web design: The CSS color #3A7BD5 breaks down as: 3A (hex) = 58 (decimal) = 00111010 (binary) for red, 7B = 123 = 01111011 for green, D5 = 213 = 11010101 for blue. Understanding binary helps web developers debug color manipulation in JavaScript. Try our Color Converter for quick translations.
Example 3 — File permissions in Linux: The command chmod 755 sets permissions using octal notation. 7 = 111 (read+write+execute for owner), 5 = 101 (read+execute for group), 5 = 101 (read+execute for others). Each octal digit maps to exactly 3 binary bits representing the three permission flags.
Tips for Working with Binary Numbers
- Memorize powers of 2: Know the sequence 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024. This makes mental conversion much faster — any decimal can be expressed as a sum of these values.
- Group binary digits in fours: When reading long binary strings, group from right to left in sets of 4 bits. Each group maps to one hexadecimal digit, making the number far easier to read (e.g., 1101 0110 = D6).
- Use hex as shorthand: Programmers rarely write full binary strings. Instead, they use hex prefixed with 0x (e.g., 0xFF = 255). Most programming languages support hex literals natively.
- Check with powers of 2: A quick verification method is to add up the powers of 2 for each "1" bit. For 11010110: 128 + 64 + 16 + 4 + 2 = 214. If the sum matches your decimal, the conversion is correct.
- Use binary for bitwise operations: AND, OR, XOR, and NOT operations work on individual bits and are fundamental to cryptography, compression, and hardware control. Understanding binary makes these operations intuitive.
Binary in Modern Computing
Modern processors operate at the binary level, executing billions of binary operations per second. A 64-bit processor can handle integers up to 2^64 - 1 = 18,446,744,073,709,551,615 in a single operation. According to Intel's documentation, current x86-64 processors use binary arithmetic in their ALU (Arithmetic Logic Unit) for all integer computations, while floating-point numbers follow the IEEE 754 binary format. Data storage sizes are measured in binary units: 1 KiB = 1,024 bytes (2^10), 1 MiB = 1,048,576 bytes (2^20), and 1 GiB = 1,073,741,824 bytes (2^30).
Frequently Asked Questions
How do you convert decimal to binary step by step?
You convert decimal to binary by repeatedly dividing by 2 and recording remainders. Take the decimal number, divide by 2, write down the remainder (0 or 1), then divide the quotient by 2 again. Continue until the quotient is 0. Read the remainders from bottom to top — that sequence is your binary number. For example, 42 becomes: 42/2=21 r0, 21/2=10 r1, 10/2=5 r0, 5/2=2 r1, 2/2=1 r0, 1/2=0 r1. Reading up: 101010. This method is taught in the ACM computer science curriculum as the standard conversion algorithm.
Why do computers use binary instead of decimal?
Computers use binary because electronic circuits have two stable states: on and off, represented by 1 and 0. This two-state system is inherently reliable — a transistor is either conducting current or not, with no ambiguous middle ground. Designing circuits with 10 stable voltage levels (for decimal) would be far more complex and error-prone. Claude Shannon proved in his 1937 master's thesis at MIT that Boolean algebra (binary logic) could be implemented with electrical switches, laying the foundation for all digital computing.
Why is hexadecimal used instead of binary in programming?
Hexadecimal is used because each hex digit represents exactly 4 binary bits, making it a compact shorthand for binary. The 8-bit value 11111111 is simply FF in hex — much easier to read and less error-prone to type. Memory addresses, color codes, MAC addresses, and hash values are all conventionally written in hex. For instance, a SHA-256 hash is 256 bits long, which would be 256 characters in binary but only 64 characters in hex.
Can this calculator convert negative numbers to binary?
This calculator handles non-negative integers. Negative numbers in binary are represented using two's complement, the standard method in virtually all modern processors. To find the two's complement of a number: convert the positive value to binary, flip all bits (0 becomes 1, 1 becomes 0), then add 1. For example, -5 in 8-bit two's complement: 5 = 00000101, flipped = 11111010, plus 1 = 11111011. The leading bit being 1 indicates a negative value.
What is the largest decimal number that fits in 8 bits?
The largest unsigned 8-bit binary number is 11111111, which equals 255 in decimal (2^8 - 1 = 255). For signed 8-bit integers using two's complement, the range is -128 to 127. Common bit-width limits include: 16-bit unsigned max = 65,535; 32-bit unsigned max = 4,294,967,295; and 64-bit unsigned max = 18,446,744,073,709,551,615. These limits are defined by the IEEE and ISO C standard and affect data types in every programming language.
How do you convert binary back to decimal?
To convert binary to decimal, multiply each bit by its positional power of 2 and sum the results. Starting from the rightmost bit (position 0), each position represents 2^n. For binary 11010110: 1x128 + 1x64 + 0x32 + 1x16 + 0x8 + 1x4 + 1x2 + 0x1 = 128 + 64 + 16 + 4 + 2 = 214. Use our Binary to Decimal Calculator for instant conversions with step-by-step breakdowns.