Convert a whole number between any bases from 2 to 36. Use binary, octal, decimal, hexadecimal, or another positional base, with exact arithmetic for large integers.
Convert between number bases
How to use the number base converter
- Enter your whole number using the digits allowed by its original base.
- Choose the original base under From base.
- Choose the desired base under To base.
- Select Convert number. The result and its decimal equivalent appear below.
Use Swap bases and result to check the reverse conversion. The button first validates the current input and then places the converted result in the input box.
Common base conversion examples
| Input | From | To | Result |
|---|---|---|---|
| 1010100 | Binary (2) | Decimal (10) | 84 |
| 1000010 | Binary (2) | Duodecimal (12) | 56 |
| 54 | Duodecimal (12) | Binary (2) | 1000000 |
| 34 | Hexadecimal (16) | Unvigesimal (21) | 2A |
| 77 | Decimal (10) | Binary (2) | 1001101 |
What is a number base?
A base specifies how many digit values a positional number system uses. Decimal uses ten digits, from 0 through 9. Binary uses two, 0 and 1. Hexadecimal uses sixteen: 0 through 9 and A through F. Each position has a value equal to a power of the base.
For example, binary 1010100 means 1 × 26 + 1 × 24 + 1 × 22 = 64 + 16 + 4 = 84. The same value can be written as 70 in base 12 or 54 in hexadecimal. A digit is invalid if its value is as large as the base: binary cannot contain 2, and octal cannot contain 8.
Conversion method and accuracy
The tool reads the input from left to right. At each digit it multiplies the accumulated value by the original base, then adds the next digit’s value. It converts to the target base by repeated division and records each remainder. Reversing those remainders gives the target digits.
Whole-number arithmetic avoids rounding large integers. This converter accepts up to 512 input digits, with an optional minus sign. Leading zeroes are removed from the result; letters are displayed in uppercase. It uses an ordinary signed-number representation, so −101 in binary becomes −5 in decimal. It does not interpret a bit pattern as two’s complement or preserve a fixed bit width.
Frequently asked questions
Can I convert a fraction such as 10.5?
This tool supports whole numbers only. Fractional base conversion requires separate precision and rounding rules, which are not applied here.
What are undecimal, duodecimal, and unvigesimal?
Undecimal is base 11, duodecimal is base 12, and unvigesimal is base 21. This tool uses A for digit value 10, B for 11, and continues alphabetically as needed.
Can I enter negative numbers?
Yes. Add a minus sign before the digits. The tool preserves the sign and converts the magnitude. Negative zero becomes zero.
What does “invalid digit” mean?
The input contains a digit that is not allowed in the selected original base. Check the From base setting and the number. For example, F is valid in hexadecimal but not in decimal.
Is the conversion done online?
The calculation runs locally in your browser. Entered values are not sent to a conversion service. The website’s usual analytics and privacy policy still apply.
Related tools: Number to Words Converter and All Calculators.