Hongmu Notes

⏬ Binary to decimal conversion

Input a binary string containing only 0 and 1, and get the decimal value instantly, with no limit on the number of digits and no loss of precision.

Binary to decimal conversion

Paste a binary string containing only 0 and 1 in the input box below, and the result will be displayed immediately; spaces and newlines will be automatically ignored.

Instructions for use

  • The input only accepts 0 and 1. For other characters, the error will be prompted at which position and no error value will be given.
  • There is no limit to the number of digits. Convert large integers digit by digit. Even long 0/1 strings will not lose accuracy.
  • The result box is read-only. Click "Copy Results" to remove it. You can also press and hold on your mobile phone to select all and copy them.

Convert binary code to decimal

"Binary code" has two meanings: one is numerical writing, for example, 1111011 means one hundred and twenty-three; the other is encoding, for example, 1001000 is regarded as the encoding of the character H. This page deals with the former, only doing numerical conversions and not interpreting bit strings into text.

📌 How to distinguish the two meanings

If what you care about is "how much does this string of 0/1 add up to", that's numerical conversion; if what you care about is "which characters does this string of 0/1 represent", that's encoding and decoding. The result of the former is a number, and the result of the latter is a paragraph of text. The processing methods of the two are completely different.

⚙️ Boundaries for numerical conversions

  • Without grouping semantic judgment, the results of 1010 1100 and 10101100 are the same.
  • No complement or signed number interpretation is performed, and the results are always summed as unsigned bit strings.
  • No character encoding mapping is performed, and an offset is not added to the result.

✅ When to change tools

To turn 1001000 into the letter H, you need to process it according to character encoding, which is a tool of the "binary to text" type. To do operations such as bitwise AND and bitwise OR, you must first calculate it in binary and then paste it in for conversion. This page always only outputs a decimal value, the logic is simple and will not be misused.

All keywords and tutorials 12

❓ FAQ

How to calculate two's complement negative numbers
This page is treated as unsigned and the sign bit will not be automatically recognized. When you need to complement the code, first confirm the bit width, judge the highest bit as the sign bit separately, then flip the other bits and add one, and finally add the negative sign manually.
What is the difference between "binary to text"
This page obtains numerical values by summing weights; binary conversion to text restores character encoding in groups of eight bits. The results of the same input string in the two tools are completely different, depending on whether you want numerical values ​​or text.
Is this decoding or conversion?
It belongs to numerical conversion, not character decoding. Binary strings are expanded and summed to obtain a decimal value; if you want to restore binary to text, please use a tool such as "Binary to Text".