Decimal to Binary Converter

Numbers people look up

DecimalBinaryBits
810004
1010104
16100005
321000006
6410000007
10011001007
12711111117
128100000008
200110010008
255111111118
2561000000009
1,000111110100010
1,0241000000000011

Works up to 9,007,199,254,740,991 — past that a browser can't tell one whole number from the next, so the bits would be a guess.

Type a decimal number, get its binary. The answer updates as you type, and underneath it you get the part most converters leave out: the divide-by-2 working, step by step, so you can check the answer or copy the method into homework. You also get the bits grouped in fours, which is how anyone actually reads a long binary string, and the list of powers of two that sum to your number — the other way to do the same conversion in your head. Negatives come back sign-magnitude, fractions like 12.625 convert too, and the whole thing runs in your browser with nothing to install and nothing to sign into.

Built by Bob Article by Lace QA by Ben Shipped

How to use

  1. 1

    Type the decimal number. Negatives (-42), grouped thousands (1,000), and decimal fractions (12.625) all work.

  2. 2

    Read the binary in the result card. The nibble-grouped version and the bit count are on the lines under it.

  3. 3

    Check the work in the divide-by-2 table: divide by two, write down the remainder, repeat. Reading the remainder column from the bottom up spells the answer.

  4. 4

    Tap Copy for the bare binary string, or Copy formula for the whole line with your number in it.

Frequently asked questions

Ratings & Reviews

Rate this tool

Sign in to leave a written review.
Loading reviews…

What is binary, and what "decimal to binary" means

Converting decimal to binary means rewriting a number from base 10 — the ten digits 0 through 9 — into base 2, which has only two digits: 0 and 1. The value never changes. 197 and 11000101 are the same quantity, written in two different alphabets.

Decimal is base 10

In decimal, each position is worth ten times the position to its right: ones, tens, hundreds, thousands. That's why 197 means 1×100 + 9×10 + 7×1. We use ten because we have ten fingers, and for no deeper reason than that.

Binary is base 2

In binary, each position is worth twice the one to its right: 1, 2, 4, 8, 16, 32, 64, 128, and on up. Each digit is called a bit. Read 11000101 from the left and you get 128 + 64 + 4 + 1, which is 197.

Computers use base 2 because a wire is either carrying current or it isn't. Two states are cheap to build and hard to misread. Ten states would need ten reliably distinguishable voltage levels on every wire in the machine, and noise would eat them. So every number inside a computer — a pixel's red channel, a timestamp, the character you just typed — is a row of bits.

Eight bits make a byte, which is where a lot of familiar numbers come from. The largest value eight bits can hold is 11111111, or 255. That's the top of an RGB colour channel and the top of an IPv4 address octet, and it's not a coincidence.

How to convert decimal to binary by hand

Divide by 2. Write down the remainder. Divide the quotient by 2. Write down that remainder. Keep going until the quotient is 0, then read the remainders from the bottom up.

That's the whole method. Here it is on 197:

  • 197 ÷ 2 = 98 remainder 1
  • 98 ÷ 2 = 49 remainder 0
  • 49 ÷ 2 = 24 remainder 1
  • 24 ÷ 2 = 12 remainder 0
  • 12 ÷ 2 = 6 remainder 0
  • 6 ÷ 2 = 3 remainder 0
  • 3 ÷ 2 = 1 remainder 1
  • 1 ÷ 2 = 0 remainder 1

Read that remainder column from the bottom to the top: 11000101. Grouped in fours for legibility, 1100 0101.

The bottom-up part trips people up, so here's why it works. Dividing by 2 and taking the remainder asks one question: is this number odd? That answer is exactly what the 1s place records. The next division asks the same question about how many 2s there are, which is the 2s place. The steps hand you the bits smallest-place-first, so writing them left to right writes them backwards. Reversing puts the largest power of two on the left, where we read it.

The Decimal to Binary Converter on this page runs those exact divisions and prints them in a table under the answer, so you can check your own working line by line instead of just trusting a result.

The powers-of-two shortcut

There's a second method, and once you know the powers of two by heart it's faster. Find the largest power of two that fits inside your number, subtract it, and repeat with what's left. Every power you used gets a 1, every power you skipped gets a 0.

Take 200. The powers in play are 128, 64, 32, 16, 8, 4, 2, 1.

  • 128 fits — 72 left over. Write 1.
  • 64 fits — 8 left over. Write 1.
  • 32 doesn't fit. Write 0. Neither does 16. Write 0.
  • 8 fits exactly — 0 left over. Write 1.
  • 4, 2 and 1 have nothing left to claim. Write 000.

That gives 11001000, and 128 + 64 + 8 is indeed 200. The Decimal to Binary Converter prints this sum under the divide-by-2 table for whatever you type — for 197 it shows 2^7 (128) + 2^6 (64) + 2^2 (4) + 2^0 (1).

The same idea tells you how many bits a number needs before you convert anything: one more than the exponent of the largest power of two that fits. 255's largest is 128, which is 2^7, so 255 needs 8 bits. Add one and 256 needs 9.

Common decimal to binary conversions

DecimalBinaryBitsWhy it turns up
001Zero is a number, so it still needs a digit
1112^0
2102Base 2 runs out of digits immediately
510134 + 1
810004Four bits is exactly one hex digit
1010104Round in decimal, unremarkable in binary
161000052^4 — one hex digit tops out at 15
3210000062^5
421010106The reason the joke lands
64100000072^6
1001100100764 + 32 + 4
12711111117Largest signed 8-bit value
128100000008The sign bit's place in a byte
255111111118Largest unsigned byte; top of an RGB channel
2561000000009One past a byte — the classic overflow
1000111110100010Round decimal numbers are ugly in binary
102410000000000112^10 — a kibibyte

Two patterns are worth memorising. Every power of two is a 1 followed by nothing but zeros, and every number one below a power of two is nothing but ones: 127 is 1111111, 255 is 11111111. If a binary string is all ones, you're one short of a power of two.

The other pattern explains the spaces. Four bits hold exactly one hexadecimal digit, so grouping in fours converts to hex for free: 1100 0101 reads off as C5, and 197 in hex is indeed C5. That's why programmers group binary in nibbles rather than in threes or fives, and it's the quickest route if you actually wanted the decimal to hex converter instead.

Negatives, fractions, and where the conversion stops

Three things break the tidy divide-by-2 story, and every one of them sends people to a converter.

Negative numbers. The Decimal to Binary Converter writes them sign-magnitude: −10 comes back as −1010, the binary of 10 with a minus sign in front. That's the plain mathematical answer, and it's what a maths class wants. Computers do it differently, with two's complement — but two's complement has no answer until you pick a width. The same −10 is 11110110 in 8 bits and 1111111111110110 in 16. A converter that hands you one of those without asking is inventing a width on your behalf, so that job lives in the bitwise operations calculator, which has a 32-bit view and lets you see the bits flip.

Fractions. The part after the decimal point works in reverse: double it, write down the whole number that pops out, keep the remainder, repeat. For 0.625 — double to 1.25, bit 1; double 0.25 to 0.5, bit 0; double 0.5 to 1.0, bit 1. So 12.625 converts to 1100.101, exactly.

Fractions that never end. A fraction terminates in binary only when its denominator is a power of two. 0.625 is 5/8 and 8 qualifies, so it stops after three bits. 0.1 is 1/10, and 10 has a factor of 5, so in base 2 it repeats forever. The Decimal to Binary Converter cuts it at 20 bits — 0.00011001100110011001 — and says plainly that it rounded down rather than pretending the answer is complete. This is not a quirk of the page; it's the reason 0.1 + 0.2 doesn't equal 0.3 in almost every programming language you'll ever use.

The converter stops at 9,007,199,254,740,991, which is 2^53 − 1 and comes back as 53 one-bits. Past that, a browser genuinely cannot tell two consecutive whole numbers apart — 2^53 and 2^53 + 1 are the same value in memory — so any bits printed for a larger number would be a confident guess. Refusing is the honest answer.

Two smaller things the input handles rather than silently mangling. Paste something starting with 0x or 0b and it tells you which converter you actually want instead of reading the digits as base 10. And type 1,250 and it reads 1,250 as one thousand two hundred and fifty, while noting that if you meant 1.25 — as a comma decimal does across most of Europe — you should type it with a dot.

Where converting decimal to binary actually comes up

Homework is the honest first answer. Intro computing courses mark the working, not the result, which is why the divide-by-2 table exists on this page at all — a bare answer gets you no credit.

After that it's mostly bit-level work. Subnet masks are decimal numbers that only make sense in binary: 255 is eight ones, and 192 is 11000000, which is what "/26" is really telling you — the CIDR calculator does the whole address if you need it. File permissions, feature flags and hardware registers pack several yes/no answers into one integer, and reading which bits are set means converting it first. Colour work runs on 0–255 channels. Anything involving character codes lands in the same place: 65 is 1000001, which is capital A, and the text to binary converter does whole strings.

Most pages that answer this question make you work for it. The conversion sits three clicks inside a developer suite billed monthly, or the steps are hidden behind a "create a free account to see the working" box, or the page loads a video ad that reflows the answer as you read it. A conversion is arithmetic that finishes in a millisecond. It shouldn't require a trial, a seat, or your email address. The Decimal to Binary Converter is a text box, an answer, and the working — no account, no trial, no counter telling you how many conversions you have left today.

Related converters

Going the other way is the most common next step: binary to decimal takes 11000101 and gives you back 197. If you're moving between more than two bases at once, the number base converter handles binary, octal, decimal and hex side by side, and hex to decimal covers the direction hex-heavy work usually needs.

For text rather than numbers, the binary decoder turns 8-bit ASCII bytes back into readable characters. And when the question is what happens to the bits rather than what they are, the bitwise operations calculator covers AND, OR, XOR, NOT and shifts across all four bases at once.

Frequently asked questions

What is 100 in binary?

1100100 — seven bits. It's 64 + 32 + 4. Worth noticing that a number as round as 100 in decimal looks arbitrary in binary, and the reverse is true too: 1024 is a beautifully clean 10000000000 in base 2 and a strange-looking number in base 10.

Why do computers use binary instead of decimal?

Because two states are physically cheap and hard to confuse. A transistor conducts or it doesn't; a magnetic domain points one way or the other. Building hardware that reliably distinguishes ten voltage levels on every wire, in a machine running billions of operations a second with electrical noise everywhere, would be far harder and slower than adding a few more wires. Base 2 is an engineering choice, not a mathematical one.

Is binary the same thing as machine code?

No, though they get conflated constantly. Binary is a way of writing numbers. Machine code is the set of instructions a specific processor understands, which happens to be stored as bits. Converting 197 to 11000101 tells you nothing about what a CPU would do with those bits — in one context they're the number 197, in another the character Å, in another an opcode.

How do I convert binary back to decimal?

Multiply each bit by its place value and add. For 1100101: 64 + 32 + 4 + 1 = 101. Line the places up from the right — 1, 2, 4, 8, 16, 32, 64 — and only count the positions holding a 1. The binary to decimal converter does it in the other direction from this page.

Is 1100 0101 the same as 11000101?

Yes. The spaces carry no value at all — they're for your eyes, the same way the commas in 1,048,576 are. Four is the standard grouping because four bits equal one hex digit, so a grouped string converts to hex at a glance. Past about eight digits, ungrouped binary is very easy to miscopy by dropping or doubling a bit.

Is there a limit on how many numbers I can convert?

No. There's no account, no daily cap, and nothing to install — it runs in your browser, so what you type never reaches a server and closing the tab is the entire cleanup. It's free. The paid side of Microapp is a membership that removes ads and prices AI at near cost, and 10% of every dollar Microapp earns goes to charity, off the top, audited quarterly.