Skip to content
OneKitly

How to Read Binary and Convert It to Decimal and Hex

Published 11/18/2025 · 4 min read · Developer tools

Daniel Okonkwo

Daniel OkonkwoFront-end developer and tech writer at OneKitly

Web performance · File formats

Checked against 2 sources

View profile
In short

Binary uses only 0 and 1, where each position is a power of 2 (1, 2, 4, 8, 16...). To convert binary to decimal, add the place values where a 1 appears: 1011 = 8 + 0 + 2 + 1 = 11. To convert to hexadecimal, group the bits into fours from the right and write each group as one hex digit (0-9, A-F).

Learn how binary place values work and convert binary to decimal and hexadecimal by hand, with clear worked examples.

How binary place values work

Decimal numbers use ten digits and each column is a power of 10: ones, tens, hundreds. Binary works the same way but with only two digits, so each column is a power of 2: 1, 2, 4, 8, 16, 32, and so on. A single binary digit is called a bit, and eight bits form a byte.

Reading right to left, the first bit is worth 1, the next 2, then 4, then 8. So the byte 00001011 has 1s in the 8, 2, and 1 columns. That is all binary is: a sum of the powers of 2 marked with a 1. Once you see the columns, every binary number becomes easy to decode.

Converting binary to decimal

Take 11010010. Label the columns 128, 64, 32, 16, 8, 4, 2, 1. The 1s sit under 128, 64, 16, and 2. Add them: 128 + 64 + 16 + 2 = 210. To go the other way, from decimal to binary, subtract the largest power of 2 that fits and repeat: 210 minus 128 is 82, minus 64 is 18, minus 16 is 2, minus 2 is 0 — the same columns light up.

This is why an 8-bit byte ranges from 0 to 255: the columns add up to 255 when every bit is a 1. It also explains why network and color values so often stop at 255 — they are stored in a single byte. Practicing a few conversions by hand builds an intuition that no memorized rule can replace.

Converting binary to hexadecimal

Hexadecimal has sixteen digits: 0 to 9 then A, B, C, D, E, F for 10 to 15. Its magic is that one hex digit maps exactly onto four bits, because four bits hold sixteen values. So converting is just grouping: 11010010 splits into 1101 and 0010, which are D and 2, giving D2.

This tight fit is why programmers lean on hex: it writes long binary strings compactly and reversibly. A color like #FF8800 is really three bytes, and a memory address in hex can be unpacked back into bits without ambiguity. When numbers get long, converting binary through hex is faster and less error-prone than going straight to decimal.

Number base converterConvert numbers between all 35 bases, exactly, with two's complement.Try the tool

Frequently asked questions

Why do computers use binary at all?
Electronic circuits reliably distinguish two states — on and off, high and low voltage — so representing data with just two digits is far more robust than trying to hold ten distinct voltage levels. Every number, letter, and image is ultimately stored as patterns of these on/off bits.
What does the 0x prefix mean?
The 0x prefix tells you the number that follows is written in hexadecimal, so 0xFF means 255, not the decimal number 255. Similarly, a 0b prefix marks binary. These prefixes remove any confusion about which base a value is in.
How many values can a byte hold?
A byte is eight bits, and eight bits give 2 to the power of 8, which is 256 distinct patterns. Counting from zero, that means values from 0 to 255. This is why so many settings, color channels, and small counters top out at 255.
Is there a quick way to check my conversion?
Convert back the other way: if 1011 gave you 11 in decimal, rebuild 11 as 8 + 2 + 1 and confirm the bits match. A base converter tool lets you enter a value in any base and instantly see the others, which is ideal for checking hand calculations.

Articles you may find interesting

All guides

Related tools

Sources

Spotted a mistake in this article?