Text & code / MULTIVERTO

Decimal to binary

Convert a whole decimal integer into base-two digits without a size limit.

Live converterYour input stays in this browser. No text is uploaded for conversion.
The file stays in your browser.
Chain tools

Apply each text tool to the previous result.

01 / Guide

How it works

Repeated powers of two express the integer with digits 0 and 1; a minus sign denotes negative values.

Good to know

The sign is written separately; these results are not fixed-width two’s-complement machine integers.

02 / Example

Example

Your input255
Result11111111

03 / Guide

Decimal to binary — How it works

Writing an integer in bits

Convert a whole decimal integer into base-two digits without a size limit. Use this tool when a decimal value in documentation or a register needs a binary representation for inspecting flags. The input is a whole number, not the characters of a text message. Enter 255 to see eight one bits. Because leading zeroes have no mathematical value, the result has only the digits needed to represent the integer.

Repeated powers of two express the integer with digits 0 and 1; a minus sign denotes negative values. Repeated division by two, or equivalently the powers of two present in the value, determines each digit. For 255, the powers from 128 down to 1 are all present, producing 11111111. Negative input keeps a minus sign before the magnitude rather than inventing a machine word size. Add leading zeroes manually if an eight- or sixteen-bit field requires fixed width. For a concrete check, the example input 255 produces 11111111. Keep the original beside the result when comparing it with another application.

What a number base changes

Decimal, binary and hexadecimal are different written forms of the same integer. Decimal has ten digits, binary has two, and hexadecimal has sixteen symbols, adding A through F after 0 through 9. The value itself does not change when its notation changes. A bit is a binary digit; four bits correspond to one hexadecimal digit, which makes hex compact for memory addresses, bit masks and debugging. Use these converters when a specification, log or programming language displays a number in a base other than the one you are reading.

Reading signs and widths correctly

The sign is written separately; these results are not fixed-width two’s-complement machine integers. These converters work with whole integers and retain arbitrary precision through BigInt, so a long value does not silently lose low bits as an ordinary floating-point number might. A leading minus sign represents a negative mathematical integer. It is not a fixed-width two’s-complement byte pattern: the bit string for minus one depends on whether a machine uses eight, sixteen, thirty-two or another number of bits. Add a width and encoding rule separately if a protocol requires one. Do not confuse the binary value of an integer with UTF-8 binary bytes of the characters used to spell it.

How this conversion transforms the input
Decimal integer
Positional digits
Binary integer