Binary and Hexadecimal Conversion: How to Convert Numbers Step by Step
October 29, 2026
We write numbers in base 10, using ten digits, where each place is worth ten times the one to its right. Computers use base 2 (binary), with digits 0 and 1, because electronic circuits have two stable states. Hexadecimal (base 16) uses the digits 0 to 9 and the letters A to F for values 10 to 15, and it is a compact way to write binary: each hex digit corresponds to exactly four binary digits (bits).
The number 255 is 11111111 in binary (eight 1s) and FF in hexadecimal. The number 1,000 is 1111101000 in binary and 3E8 in hex.
Skip the math and get your answer instantly:
Open the Scientific Calculator →Decimal to Binary: Repeated Division
Divide the number by 2 repeatedly, recording the remainders; read them from last to first. For 1,000: 1,000 ÷ 2 = 500 r 0; 500 ÷ 2 = 250 r 0; 250 ÷ 2 = 125 r 0; 125 ÷ 2 = 62 r 1; 62 ÷ 2 = 31 r 0; 31 ÷ 2 = 15 r 1; 15 ÷ 2 = 7 r 1; 7 ÷ 2 = 3 r 1; 3 ÷ 2 = 1 r 1; 1 ÷ 2 = 0 r 1. Reading the remainders from bottom to top gives 1111101000. Check by place values: 512 + 256 + 128 + 64 + 32 + 8 = 1,000.
Binary to decimal works in reverse: multiply each digit by its place value (1, 2, 4, 8, 16, ...) and add. 1011 = 8 + 0 + 2 + 1 = 11.
| Decimal | Binary | Hex |
|---|---|---|
| 10 | 1010 | A |
| 15 | 1111 | F |
| 16 | 10000 | 10 |
| 100 | 1100100 | 64 |
| 255 | 11111111 | FF |
| 256 | 100000000 | 100 |
| 1,000 | 1111101000 | 3E8 |
| 2,026 | 11111101010 | 7EA |
Hex Conversion
To convert decimal to hex, divide by 16 repeatedly. For 1,000: 1,000 ÷ 16 = 62 r 8; 62 ÷ 16 = 3 r 14 (E); 3 ÷ 16 = 0 r 3. Reading upward: 3E8. To convert hex to decimal: 3E8 = 3 × 256 + 14 × 16 + 8 = 768 + 224 + 8 = 1,000. To convert between binary and hex, group the bits in fours from the right: 1111101000 becomes 0011 1110 1000, which is 3, E, 8. Hex is therefore a shorthand for binary that is far easier to read: a 32-bit number takes 8 hex digits.
Where You See Them
Web colors use hex: #FF8800 means red = FF (255), green = 88 (136), blue = 00 (0), a bright orange, with each channel from 0 to 255. Memory addresses and error codes appear in hex. IP addresses in IPv4 use four decimal numbers from 0 to 255 (each 8 bits), and IPv6 uses hex. File permissions in Unix use octal (base 8): 755 means owner can read, write, and execute (7 = 111), others read and execute (5 = 101). Storage sizes are powers of two: 1 byte = 8 bits holds 256 values; 1 KiB = 1,024 bytes. Doubling the number of bits squares the number of values: 16 bits hold 65,536 values.
Quick Tricks
Powers of two to memorize: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1,024. A number with all 1s in n bits equals 2ⁿ − 1: eight 1s is 255. Adding a zero on the right in binary doubles the number, as adding a zero in decimal multiplies by ten. A calculator in programmer mode or a spreadsheet function (DEC2BIN, DEC2HEX, HEX2DEC) can verify results. For byte math, remember that FF is 255 and 80 is 128.
Frequently Asked Questions
What is 255 in binary and hex?
11111111 in binary and FF in hex.
How do I convert decimal to binary?
Divide by 2 repeatedly and read the remainders from last to first.
Why do programmers use hexadecimal?
Each hex digit represents exactly four bits, making binary numbers compact and readable.
What does #FF0000 mean?
A web color with maximum red and no green or blue.
How many values can 8 bits represent?
256, from 0 to 255.