[64137 views]

A number system with a base 10 is known as decimal number system. Hence, decimal numbers are denoted with a base 10.

This number system consists of 10 digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. Each digit in the decimal system has a position and every digit is ten times more significant than the previous digit.

For example: (461)_{10} , (370)_{10} , (890)_{10} , (400)_{10} , etc.

A number system with a base 2 is known as binary number system. Hence, binary numbers are denoted with a base 2. It consists of two values: 0 and 1.

Each digit in this system is said to be a bit. For example: (110101)_{2}, (10101101)_{2}, (10000)_{2}, (10)_{2}, etc.

We will start off by taking the number to be converted as user input. The idea behind this conversion is to extract the last digit from the number one at a time and multiply it with 2 to the power of the number’s position. This process is repeated for all the digits of the number. After this, all these products are added and the final sum is the corresponding decimal number. Let us take a look at an example for better understanding:

Given binary number: (10110)_{2}

Corresponding decimal number = (1*2^{4}) + (0*2^{3}) + (1*2^{2}) + (1*2^{1}) + (0*2^{0})

= 16 + 0 + 4 + 2 + 0

= 22

- Java IDE Online
- Python IDE Online
- JSON Formatter/Minifier Online
- Case Converter
- Reverse String
- HTML Encoder
- HTML Decoder
- URL Encoder
- URL Decoder
- Decimal To Binary
- Binary To Decimal
- Decimal To Octal
- Binary To Octal
- Decimal To Hexadecimal
- Hexadecimal To Decimal
- Hexadecimal To Binary
- Octal To Decimal
- Octal to Hexadecimal
- Octal to Binary
- Calculate String Length
- Remove Spaces
- Remove Line Breaks
- Remove Empty Lines
- Remove Duplicate Lines
- Word Counter
- Replace Space with hyphen
- Check Armstrong number
- Text to URL