Binary to Decimal Converter
ED-12Paste whole numbers, one per line, and choose the base they are in and the base you want. Binary, octal, decimal, hex and bases up to 36 are covered, with no rounding.
Runs in your browser. Nothing is uploaded.
Numbers (one per line)
Result
How to use it
- Paste one whole number per line. Prefixes 0x, 0b and 0o are understood.
- Set From to the base of your numbers. For binary, choose Binary (2).
- Set To to the base you want, such as Decimal (10).
- Press Convert, or press Show binary, octal, decimal, hex to see all four at once.
- Copy the result.
Exact numbers of any size
The tool uses big-integer arithmetic, so there is no rounding at 2^53 or 2^64. A 64-bit value, a 128-bit hash read as a number, or a number with hundreds of digits converts exactly. Bases 2 to 36 are supported, using the digits 0 to 9 and then the letters a to z. Underscores are ignored, so 1_000_000 works. A minus sign is kept in front of the converted digits. This is signed notation, not two's complement.
How the starting base is chosen
In Auto mode, a number is read as hex if it starts with 0x, binary if it starts with 0b, octal if it starts with 0o, and decimal otherwise. So ff alone is an error in Auto mode, while 0xff works. If you choose a base yourself, a matching prefix is accepted and removed. For hex, 0b1 is valid hex digits and read as 177 there. Digits that do not belong to the base are reported.
Limits
Only whole numbers are supported, so a fractional value such as 12.5 gives an error. Spaces inside a number are rejected, to avoid silently joining two numbers; put one number on each line instead. For converting text rather than numbers, see the Text to Hex, Binary to Text and ASCII Converter tools on this site.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
"f" is not a valid decimal digit. Numbers without a prefix are read as decimal in Auto mode; set "From" to the right base, or add 0x, 0b or 0o. | A letter was found in a number that Auto mode reads as decimal. | Set From to Hexadecimal (16), or write the number with a 0x prefix. |
"2" is not a valid binary digit. | A digit is outside the range of the chosen base, here a 2 in a binary number. | Correct the digit, or choose the base your number is really in. |
Only whole numbers are supported; the decimal point cannot be converted. | The number has a decimal point or fraction. | Convert the whole-number part only. |
A number cannot contain spaces. Remove them, or put one number on each line. | A line holds spaces between digits, so it is not clear whether it is one number or several. | Remove the spaces, or put each number on its own line. |
Questions people ask
How do I convert binary to decimal?
Paste the binary number, set From to Binary (2), set To to Decimal (10) and press Convert. For example, 11111111 gives 255. A leading 0b is also accepted, and in Auto mode it selects binary on its own.
How do I convert decimal to binary?
Paste the decimal number, leave From on Auto or choose Decimal (10), set To to Binary (2) and press Convert. For example, 255 gives 11111111. Tick the prefix box if you want 0b11111111.
How do I convert hex to decimal?
Paste the hex number, with or without 0x, set From to Hexadecimal (16) and To to Decimal (10). For example, ff gives 255. In Auto mode, include the 0x prefix, or it is read as decimal.
Does it handle very large numbers?
Yes, with no rounding. It uses exact big-integer arithmetic, so a number with 30 or 300 digits converts correctly. Tools based on ordinary floating-point numbers begin to lose digits above 9007199254740991.
How does it handle negative numbers?
A leading minus sign is kept, so -0xff in Auto mode to binary gives -11111111. The result is the signed value, not a two's complement bit pattern, because the width in bits is not known.
Which bases are supported?
Every base from 2 to 36. Digits above 9 are the letters a to z, in either case. Binary, octal, decimal and hexadecimal have their own names in the menu, and the other bases are listed by number.
About this tool
Numbers are converted with exact big-integer arithmetic, so there is no rounding at 2^53 or 2^64. Put one whole number on each line. Set "From" to the base of what you pasted, for example Binary to read 1010 as binary. In Auto mode a number is read as hex, binary or octal only if it starts with 0x, 0b or 0o, and otherwise as decimal. A matching prefix is also accepted when you pick the base yourself. Underscores are ignored. A minus sign is kept in front of the converted digits: this is signed notation, not two's complement. Fractions are not supported.