Base-N Converter
Computers count in binary, programmers write in hexadecimal, and the rest of us count in decimal. The CalcNova base-n converter translates a whole number between these bases for you: type a number, tell the tool which base it is written in, and see the same value in decimal, binary, octal, and hexadecimal at the same time.
Base-n converter
Type a number, pick the base it is written in, and see it in decimal, binary, octal, and hexadecimal instantly. Everything runs in your browser.
How the base-n converter works
Type any whole number into the box and choose the base it is written in: Decimal (base 10), Binary (base 2), Octal (base 8), or Hexadecimal (base 16). The converter first checks that every digit is legal in that base — binary accepts only 0 and 1, octal accepts 0 to 7, and hexadecimal accepts 0 to 9 plus the letters A to F.
It then reads your number into an ordinary value using the base you picked, and writes that value back out in all four bases. Everything updates as you type, so you can watch 255 turn into 11111111, 377, and FF without pressing a button.
If a digit does not belong in the chosen base — for example, typing 2 while Binary is selected — the converter shows a message instead of guessing. Hexadecimal letters work in upper or lower case, and results always print hex digits in upper case, the way most programming references write them.
Place values and the four bases
A base-n number is a sum of its digits times powers of n. In decimal, 255 means 2 × 100 + 5 × 10 + 5 × 1. The same idea works in every base:
- Binary (base 2) uses only the digits 0 and 1. Its places run 1, 2, 4, 8, 16, 32, and keep doubling.
- Octal (base 8) uses the digits 0 to 7. Its places run 1, 8, 64, 512, and keep multiplying by 8.
- Hexadecimal (base 16) uses the digits 0 to 9 plus A = 10, B = 11, C = 12, D = 13, E = 14, and F = 15. Its places run 1, 16, 256, 4096, and keep multiplying by 16.
- Decimal (base 10) is the everyday system, with places 1, 10, 100, 1000, and so on.
To convert by hand, multiply each digit by its place value and add. For 1A in hexadecimal: 1 × 16 + 10 × 1 = 26. To go the other way, divide by the new base again and again and read the remainders from last to first: 26 ÷ 2 leaves the remainders 0, 1, 0, 1, 1, which read backwards give 11010 in binary.
Worked examples
1. 255 in decimal
Binary: 255 = 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1, so 255 in decimal is 11111111 in binary. Octal: 255 = 3 × 64 + 7 × 8 + 7, so it is 377 in octal. Hexadecimal: 255 = 15 × 16 + 15, and 15 is the digit F, so it is FF in hexadecimal.
2. 1010 in binary
Reading the place values: 1 × 8 + 0 × 4 + 1 × 2 + 0 × 1 = 10 in decimal. For octal: 10 = 1 × 8 + 2, so 12 in octal. For hexadecimal: 10 is the digit A, so A in hexadecimal.
3. 1A in hexadecimal
1 × 16 + 10 = 26 in decimal. In binary: 26 = 16 + 8 + 2, so 11010 in binary. In octal: 26 = 3 × 8 + 2, so 32 in octal.
4. 777 in octal
7 × 64 + 7 × 8 + 7 = 448 + 56 + 7 = 511 in decimal. 511 is one less than 512 (2⁹), so in binary it is nine ones: 111111111. In hexadecimal: 511 = 1 × 256 + 15 × 16 + 15, so 1FF in hexadecimal.
Common mistakes
- Reading “10” as ten in every base. The digits 10 mean 2 in binary, 8 in octal, and 16 in hexadecimal — the value depends on the base.
- Typing a digit the base does not allow, such as 2 in a binary number or 8 in an octal number. Each base has a fixed set of legal digits.
- Mixing up the letter O with the digit 0 in hexadecimal. Hex uses only the letters A to F, so a number containing O is a typo.
- Thinking hexadecimal is case-sensitive. The lowercase ff and the uppercase FF are exactly the same number.
- Forgetting that each hexadecimal digit stands for exactly four binary digits when converting by hand. A is 1010, not 101 — dropping a leading zero misaligns every digit after it.
Privacy and accuracy
Like every CalcNova tool, the base-n converter runs entirely in your browser: the numbers you type are never sent to a server, stored online, or shared with anyone. Conversions use your browser’s exact integer arithmetic for whole numbers up to 9,007,199,254,740,991 (2⁵³ − 1); beyond that, very large values can lose precision. The tool converts whole numbers only — it does not handle fractions or decimal points — and it accepts a minus sign only for decimal input.
Frequently asked questions
What does “base-n” mean?
Base-n means a counting system with n different digits. Decimal is base 10, binary is base 2, octal is base 8, and hexadecimal is base 16. The “n” is just a placeholder for whichever base you are talking about.
Why do computers use binary?
Computer hardware stores information as tiny switches that are either on or off, which maps directly onto the two binary digits 0 and 1. Underneath every file, image, and program, everything is binary.
Why do programmers use hexadecimal?
Hexadecimal is a compact shorthand for binary: each hex digit stands for exactly four binary digits, so a long binary string becomes a short hex string that is easier to read and type. That is why memory addresses and color codes such as #FF0000 are written in hex.
How do I convert a number between bases by hand?
To read a number, multiply each digit by its place value (powers of the base) and add the results. To write a number in a new base, divide by the new base repeatedly and read the remainders from last to first.
Can the converter handle negative numbers?
The converter accepts a minus sign for decimal input: −42 in decimal converts to −101010 in binary, −52 in octal, and −2A in hexadecimal. Negative binary, octal, or hexadecimal input is not accepted — enter the positive value and add the sign yourself.
What is the largest number I can convert?
The tool handles whole numbers up to 9,007,199,254,740,991 (2⁵³ − 1), the largest integer your browser can represent exactly. Larger values may lose precision, so very large numbers belong in a specialized big-integer tool.
Related tools
- Online scientific calculator — for everyday arithmetic, percentages, and functions.
- Scientific Notation Converter — for writing very large and very small decimal numbers compactly.
- Unit Converter — for length, weight, temperature, area, volume, and speed.
- Equation Solver — for linear and quadratic equations with the discriminant and roots shown.
- CalcNova FAQ — answers to general questions about the site’s calculators.
