Decimal to Binary Converter – Fast & Free Online Tool

Convert decimal to binary instantly in your browser – no signup, no uploads. See the result in binary, hex, and octal at once. Free and private.

Binary

11111111

In every base

Binary11111111
Octal377
Decimal255
HexFF

Converts instantly in your browser — arbitrarily large numbers supported. Prefixes 0b / 0o / 0x and spaces are accepted.

Convert Any Decimal Number to Binary in One Click

Type a decimal number (base 10) and instantly get its binary equivalent (base 1s and 0s). The result also shows the value in octal and hexadecimal – handy when you need all bases at once. Everything runs in your browser, so your numbers are never uploaded or stored anywhere.

How to Use the Decimal to Binary Converter

  1. Type your decimal number into the input field above.
  2. The tool instantly shows the binary output – no button press needed.
  3. Copy the binary result with one click.
  4. Need the reverse? Swap the direction to binary to decimal in the same tool.

Worked Example: Decimal 45 → Binary

Let's convert 45 to binary step by step. The method is to divide by 2 repeatedly and read the remainders from bottom to top.

StepDivisionQuotientRemainder (bit)
145 ÷ 2221 (LSB)
222 ÷ 2110
311 ÷ 251
45 ÷ 221
52 ÷ 210
61 ÷ 201 (MSB)

Reading the remainders from bottom to top gives: 101101. So 45 in decimal = 101101 in binary. The tool gives you that result the moment you finish typing.

Quick Reference: Common Decimal to Binary Values

DecimalBinaryHexOctal
0000
1111
81000810
101010A12
16100001020
451011012D55
1281000000080200
25511111111FF377

How to Convert Decimal to Binary in Code

Sometimes you need this in a script rather than a one-off lookup. Here are minimal, copy-pasteable snippets for the two most common languages.

Python

# Python 3 – built-in bin() returns a string like '0b101101'
decimal_number = 45
binary_string = bin(decimal_number)        # '0b101101'
clean_binary  = bin(decimal_number)[2:]    # '101101'  (strip the '0b' prefix)
print(clean_binary)

JavaScript

// JavaScript – Number.prototype.toString(base)
const decimal = 45;
const binary  = decimal.toString(2);   // '101101'
console.log(binary);

Both snippets convert 45 to 101101. Python's bin() and JavaScript's .toString(2) both handle large integers correctly.

How It Works Under the Hood

Binary (base 2) uses only the digits 0 and 1. Each position in a binary number represents a power of 2 – the rightmost bit is 2⁰ (1), the next is 2¹ (2), then 2² (4), and so on.

Converting decimal to binary means repeatedly dividing by 2 and recording the remainders, exactly as shown in the worked example above. The tool performs this in your browser using JavaScript's native integer arithmetic, so large numbers up to the limits of JavaScript's BigInt are handled accurately without any server round-trip. You can read more about positional numeral systems in the MDN docs on Number.toString().

When to Use This Tool – and When Not To

  • Use it for: reading bitfields, checking permission flags (like Unix chmod values), understanding IP subnet masks, studying computer science basics, or debugging hardware registers.
  • Use it for negative numbers carefully: this tool converts the magnitude. Negative binary representations (two's complement) depend on the bit width – for example, -1 in 8-bit two's complement is 11111111. For signed conversions, you'll want a dedicated two's complement calculator.
  • Don't use it for floating-point: decimal fractions like 3.14 have a separate IEEE 754 binary representation. This tool handles integers only.
  • For hex conversions: the tool simultaneously shows the hexadecimal value, saving you a second lookup when you need both.

The tool also converts in the other direction – just flip the input to binary to decimal – and handles very large integers that would overflow a standard 32-bit integer.

Your Data Stays Private

This converter runs entirely in your browser. No number you type is ever sent to a server or logged. Close the tab and it's gone.

Ready to convert? Enter your number in the tool above and the binary result appears instantly. If you work with JSON data day-to-day, you might also find the JSON Beautifier – Format, Validate & Minify JSON Online or the JSON Validator – Check & Fix JSON Errors Online (Free) useful for your workflow.

Frequently asked questions

How do I convert decimal to binary by hand?+
Divide your decimal number by 2, write down the remainder (0 or 1), then divide the quotient by 2 again. Keep going until the quotient reaches 0. Read the remainders from last to first – that's your binary number. For example, 45 → remainders 1,0,1,1,0,1 read bottom-up = 101101.
Is this tool free? Do I need to sign up?+
Completely free, no account needed. Just open the page, type your number, and copy the result.
Does the tool store or upload my numbers?+
No. The conversion runs entirely in your browser using JavaScript. Nothing is sent to any server, and nothing is logged.
Can it handle very large decimal numbers?+
Yes. The tool uses JavaScript's BigInt arithmetic under the hood, so it can accurately convert integers far larger than the standard 32-bit or 64-bit integer limits.
Can I convert binary back to decimal with the same tool?+
Yes – just swap the direction in the tool. Type your binary number and it returns the decimal value instantly.
How do I convert decimal to binary in Python?+
Use the built-in bin() function: bin(45) returns '0b101101'. Strip the '0b' prefix with bin(45)[2:] to get '101101'.
How do I convert a decimal number to binary in JavaScript?+
Call .toString(2) on any integer: (45).toString(2) returns the string '101101'. No libraries needed.
Does this tool handle decimal fractions or negative numbers?+
It handles positive integers only. Negative numbers in binary depend on bit-width and representation (such as two's complement), which varies by context. Decimal fractions like 3.14 use IEEE 754 floating-point binary, which is a completely different format.