Text & code / MULTIVERTO

Decimal to binary

Convert a whole decimal integer into base-two digits without a fixed 32-bit or 64-bit width.

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. Text workflows ↗

Only the recipe name and tool order are saved in this browser. Your input and results are never saved.

01 / Example

Example

Your input255
Result11111111

02 / Guide

Decimal to binary — How it works

Writing an integer in bits

Convert a whole decimal integer into base-two digits without a fixed 32-bit or 64-bit width. 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.

What a number base changes

Binary is particularly useful for seeing which powers of two are present in a whole number. The output is a mathematical base-two spelling; its leading minus sign is not a fixed-width signed machine pattern. 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 rightmost bit carries one, the next carries two, then four and eight; decimal 10 therefore reads 1010. In a permissions flag or device register, a set bit often has a defined meaning supplied by that specification. This converter supplies the mathematical bits only, without assigning those meanings. It also omits leading zeroes, so a four-bit 1010 may need padding before it is placed in an eight-bit field. For a negative input, select a fixed width and signed encoding separately rather than treating the leading minus as a two’s-complement bit pattern.

For a concrete check, the example input 255 produces 11111111. Read the rightmost bit as the smallest place value and check a short input by adding the powers represented by set bits. When copying to a permission mask or register, determine the required width before adding leading zeroes. The converter does not choose byte order or signed representation for that destination. Reverse conversion should recover the integer even if the target system displays a padded bit field.

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

Explore guides

Conversion guides

Explore guides