Base Calculator

Digits in the "from" base. 0x, 0b and 0o prefixes, spaces and underscores are accepted; a leading minus sign is allowed.
Written in the same "from" base. For shifts this is the number of bit positions, read as a plain decimal count.
Used for the two's complement pattern and for bitwise operations.
Result in the target base
10
Number Base Converter and Binary Calculator
Decimal value
10
Binary
1010
Octal
12
Hexadecimal
a
Decimal value (numeric)
10
Bits needed (magnitude)
4
Two's complement pattern
00001010
One's complement pattern
00001010
Unsigned value of that pattern
10
Binary in nibbles
1010
Worked out from Donald E. Knuth, The Art of Computer Programming, Volume 2: Seminumerical Algorithms, section 4.1 (Positional Number Systems) and 2 other sources.

How this is worked out

2 steps
  1. "1010" read in base 2 is 10 in decimal.
  2. 10 in base 10 is 10.

Results are general information, not financial, tax, legal, medical or engineering advice.