Conversion between binary, octal, decimal and hexadecimal bases
Non-negative whole numbers • Answers without prefixes (0b, 0x)
The Nalgoritmo base conversion generator creates exercises to convert whole numbers between the binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16) number systems. Choose the source and target bases, the number of exercises and the difficulty, type your answers and check them, or study the step-by-step solution of each conversion.
It was made for students and teachers of computer science, digital electronics, computer architecture and mathematics who want quick, unlimited practice with number systems.
Divide the number by 2 repeatedly and write down each remainder until the quotient is 0. The binary number is the remainders read from bottom to top. For example: 13 ÷ 2 = 6, remainder 1; 6 ÷ 2 = 3, remainder 0; 3 ÷ 2 = 1, remainder 1; 1 ÷ 2 = 0, remainder 1; so 13 in decimal is 1101 in binary. The same method works for octal (dividing by 8) and hexadecimal (dividing by 16).
Multiply each digit by the base raised to the position of the digit, counting from 0 on the right, and add the results. For example, 2F in hexadecimal is 2 × 16¹ + 15 × 16⁰ = 47 in decimal.
Hexadecimal uses sixteen digits: 0 to 9 and the letters A to F, where A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15. Answers can be typed in upper or lower case.
Type the answer in the target base, without prefixes such as 0b or 0x. Spaces and leading zeros are ignored, and upper and lower case letters are accepted. If a digit does not exist in the target base, the generator tells you instead of marking the answer as wrong.
Yes. Click “Print” to print the list of exercises without the settings and the buttons; in study mode, the solutions are printed too.