The Number System Converter allows you to convert numbers between various numeral systems.
Supports conversion between decimal (base 10), binary (base 2), octal (base 8), and hexadecimal (base 16). Very useful for programmers, computer science students, and anyone working with number systems.
Calculator information
๐ How to use this calculator
- Choose the source base: Decimal (10), Binary (2), Octal (8), or Hexadecimal (16).
- Enter the number in the source base. Binary uses only 0-1, octal 0-7, hex 0-9 and A-F.
- Pick the target base. You can select multiple targets at once for parallel conversion.
- Click Convert to see results across every target base plus the calculation steps.
- Open the Explanation tab to see manual conversion (successive division or sum of powers).
- For negative numbers, the calculator shows the two's complement representation in 8-bit, 16-bit, or 32-bit (useful for programming).
๐งฎ Conversion Between Number Bases
Decimal to base-n: divide repeatedly by n, read remainders bottom-up. Base-n to decimal: sum(digit_i * n^i)
- n = target base (2, 8, 10, or 16)
- digit_i = the i-th digit from the right (starting at 0)
- Hexadecimal: A=10, B=11, C=12, D=13, E=14, F=15
Converting through decimal as an intermediary works universally. For direct binary-to-hex, group 4 binary bits = 1 hex digit. For binary-to-octal, group 3 binary bits = 1 octal digit.
๐ก Worked example: Convert decimal 173 into all bases
Given:- Number = 173 (base 10)
- Target = binary, octal, and hexadecimal
Steps:- To binary: divide 173 by 2 repeatedly: 173/2=86 r 1, 86/2=43 r 0, 43/2=21 r 1, 21/2=10 r 1, 10/2=5 r 0, 5/2=2 r 1, 2/2=1 r 0, 1/2=0 r 1. Read bottom-up: 10101101
- To octal: divide 173 by 8: 173/8=21 r 5, 21/8=2 r 5, 2/8=0 r 2. Result: 255
- To hex: divide 173 by 16: 173/16=10 r 13(D), 10/16=0 r 10(A). Result: AD
- Hex verification: A x 16 + D = 10 x 16 + 13 = 160 + 13 = 173. Correct.
Result: 173 (decimal) = 10101101 (binary) = 255 (octal) = AD (hexadecimal).
โ Frequently asked questions
Why do computers use binary?
Computer electronics rely on transistors with two stable states: on (1) and off (0). Binary maps well to electrical signals because it only needs two voltage levels, and is far more noise-tolerant than a decimal system that would need 10 levels. All digital data, from text to video, is ultimately encoded in binary.
What is hexadecimal used for in modern programming?
Hex is used because it's more compact than binary: 1 byte (8 bits) = 2 hex digits. Common uses: CSS color codes (#FF5733), memory addresses (0x7FFE0000), MAC addresses (00:1A:2B:3C:4D:5E), and MD5/SHA hashes. FF is much easier to read than 11111111.
How do I quickly convert binary to hex?
Group binary digits in 4s from the right, then map each group to a hex digit. Example: 11010110 splits into 1101 0110 = D6. For binary to octal, group in 3s: 11010110 becomes 011 010 110 = 326. This works because 16 = 2^4 and 8 = 2^3, so the conversion is direct without going through decimal.
What's the difference between signed and unsigned in binary?
Unsigned represents only non-negative numbers: an 8-bit unsigned value holds 0 to 255. Signed reserves one bit for the sign: 8-bit signed (two's complement) holds -128 to 127. Two's complement makes addition and subtraction with negatives behave like operations with positives in hardware, which is far more efficient.
What is base64 and why is it used?
Base64 is an encoding that represents binary data using 64 printable characters (A-Z, a-z, 0-9, +, /). Every 3 bytes of binary (24 bits) become 4 base64 characters (4 ร 6 bits). It's used in email attachments (MIME), data URIs for inline images in HTML, and JSON Web Tokens (JWT). Unlike base 2/8/16, base64 is not a numeric system - it's a text encoding.
๐ Sources & references
Last updated: May 11, 2026