Skip to content
BCBinary Code Translator
Menu

Decimal to Binary Converter

Convert base-10 decimal integers into base-2 binary instantly. Great for programming, computer science homework, and number-system practice.

Decimal InputDecimal → Binary
0 chars
Binary Output
0 chars
Try an example

How Decimal Becomes Binary

Binary is a positional base-2 notation. Each bit represents a power of two, so converting a non-negative decimal integer means finding which powers of two add up to the value.

For 42, the useful powers are 32 + 8 + 2. Marking those positions with 1 gives:

42 = 32 + 8 + 2 = 101010₂

Decimal Binary Useful boundary
8 1000 Power of two
42 101010 Worked example
127 1111111 Largest positive signed 8-bit value
128 10000000 Sets the high bit in one byte
255 11111111 All bits set in one byte
256 100000000 Requires 9 bits

Input Rules and Width

This converter accepts decimal digits for non-negative integers and uses exact integer arithmetic rather than floating-point math. It does not accept decimal fractions, a leading minus sign, or prefixes such as 0x.

The result uses the shortest binary representation, so decimal 5 becomes 101, not 00000101. If a protocol requires an 8-, 16-, or 32-bit field, pad with leading zeros only after you know the required width.

For negative fixed-width integers, use the Two’s Complement converter. For arbitrary source and target bases, use the Base converter.

Frequently asked questions

What is decimal to binary conversion?

It converts a base-10 number into base-2 notation using only 0 and 1.

Can I convert large decimal numbers?

Yes. Paste a decimal integer and the converter will calculate the binary value in your browser.

Why do programmers use binary?

Computers store and process information with bits, so binary helps explain memory, flags, masks, and low-level data.

Is my input sent to a server?

No. The conversion runs locally in your browser.

Related tools

View all tools

Cookie Preferences

Manage your cookie preferences. Necessary cookies cannot be disabled.

Necessary

Required

Required for language selection, privacy choices, and basic site functionality.

Cookies: NEXT_LOCALE

Analytics

Optional analytics cookies help us understand traffic and improve the website.

Cookies: _ga, _gid, _gat, _clck, _clsk

Advertising

Optional advertising cookies may be used to show relevant ads and measure performance.

Cookies: __gads, _gcl_au, IDE