Decimal to Binary Converter

Convert decimal numbers to binary instantly — padded to whole bytes if you like — with two's complement for negative numbers.

What It Does

This converter writes a decimal number in binary. It works for any size — the arithmetic is exact, not floating point — and can pad the result to whole bytes and group it into nibbles so it reads like a memory dump. For a negative number it shows the minus-sign form and, alongside it, the two's-complement bit pattern a computer actually stores.

When to Use It

  • You are setting bit flags and want to see which bits a decimal constant turns on.
  • You are learning or teaching how numbers are represented in binary.
  • You need the stored bit pattern of a negative integer for a low-level protocol or a test.
  • You have a list of decimal IDs or codes to convert in one go.

Worked Examples

42

101010. Tick Pad to whole bytes to see 00101010, the way it sits in an 8-bit register.

-5

Written as −101, but stored as the 8-bit two's-complement pattern 1111 1011.

1024

10000000000 — a single 1 followed by ten zeros, because 1024 is 2^10. Powers of two are always a lone 1 in binary.

Features

Converts as you type
Bulk conversion one number per line
Exact for numbers of any size
Digit grouping and 0x/0b/0o prefixes
Swap direction in one click
Explains bit width and two's complement

How to Use

1. Type or paste a decimal number — or a list, one per line. 2. The binary value appears alongside, line for line. 3. Use the options to group digits or add a prefix, and the swap button to convert the other way.

Common Mistakes

  • Converting a number through a JavaScript Number. Above 9,007,199,254,740,991 it silently rounds, so the last digits come out wrong. This tool uses BigInt and stays exact at any size.
  • Forgetting that the same digits mean different values in different bases. 10 is ten in decimal, two in binary, eight in octal and sixteen in hex — always label which base a value is in.
  • Treating a minus sign as how a computer stores a negative number. Hardware uses two's complement, so a negative value's bit pattern looks nothing like its positive counterpart.

Frequently Asked Questions

Conversion runs in your browser with exact integer arithmetic. Nothing is uploaded.

Explore related topics

#Developer #Converter