How to use the Binary converter tool
- Enter a whole number in the Number box, for example 101101.
- Choose the base the number is written in under Input base: Binary (base 2), Decimal (base 10), Hexadecimal (base 16) or Octal (base 8).
- Select Convert. The Example button converts binary 101101.
- Read the four lines in the Result box, one each for binary, decimal, hexadecimal and octal.
- Select Copy to copy all four lines, or Clear to reset the form.
One number, four notations
A base, or radix, is the number of distinct digits a positional system uses. Decimal has ten, binary two, octal eight and hexadecimal sixteen, with A to F standing for ten to fifteen. The value itself does not change between bases, only the way it is written.
Binary is what hardware stores. Hexadecimal and octal are compact ways to write binary, because one hex digit covers four bits and one octal digit covers three. Decimal is for people. Developers move between all four when reading memory dumps, bit masks, color codes, file modes and protocol fields.
Worked example with the binary converter
With Input base left at Binary (base 2), the sample 101101 is read as 32 + 8 + 4 + 1 = 45. The result lists that value in every supported base. Selecting Decimal and entering 45, or selecting Hexadecimal and entering 2d, produces the same four lines.
binary: 101101
decimal: 45
hexadecimal: 2D
octal: 55How the conversion is done
The tool parses the input one digit at a time: it multiplies a running total by the base and adds the digit's value. The total is held as a JavaScript BigInt, an integer type with no fixed size, and is then written out in each target base. Nothing passes through floating point, so results stay exact well past 64 bits. Decimal 18446744073709551615 correctly becomes sixteen F digits in hex and sixty-four 1 bits in binary.
Input rules, prefixes and errors
The Input base setting controls how the Number box is read, and it starts on Binary (base 2).
Check the base before converting. A prefix from a different base is not detected automatically: with Hexadecimal selected, 0b11 is read as the hex digits 0B11, which is 2833.
- Whole numbers only. Decimal points, spaces inside the number, commas and underscores are rejected.
- A leading minus sign is allowed. All four results then carry a minus sign. No two's complement pattern is produced.
- The prefix of the selected base is accepted: 0b for binary, 0o for octal and 0x for hexadecimal. Decimal has no prefix.
- Hex digits may be upper or lower case. Hex output is uppercase.
- Input length is limited to 4,096 characters.
- A digit that does not belong to the base stops the conversion with a message such as Invalid base-2 digit: 2.
Frequently asked questions
How do I convert decimal to binary with this tool?
Type the decimal number in the Number box, set Input base to Decimal (base 10) and select Convert. The first line of the result is the binary form.
Why does my input show an invalid digit error?
The number contains a character that does not exist in the selected base, such as 2 in binary, 8 in octal or F in decimal. The most common cause is leaving Input base on Binary while entering a decimal or hex value.
Can it convert negative numbers?
Yes. Start the number with a minus sign. The tool converts the magnitude and prefixes each result with a minus, so -255 in decimal gives -11111111, -FF and -377. It does not output a two's complement word.
Is there a maximum number size?
The input can be up to 4,096 characters. Within that limit the conversion is exact, because the tool uses big-integer arithmetic. A 4,096-digit hexadecimal number expands to as many as 16,384 binary digits without rounding.
Does the converter handle fractions like 10.5?
No. It works with whole numbers only, and a decimal point is reported as an invalid digit.
Is the number I enter sent to a server?
No. Parsing and conversion run as JavaScript in your browser, and the page makes no request with your input.