molecalculator

Moles & Molar Mass

Base N Calculator: Convert Numbers Between Bases

Calculator No. 01-6724 · Updated · Formula and assumptions shown below

Converted value in target base 42
Number to convert
42
Set in the form below
Source base
10
Set in the form below
Target base
2
Set in the form below
You enter
Number to convert, Source base, Target base
You get
Converted value in target base
Rounding
0 dp

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

A base-n calculator converts a number written in one number system into another, such as binary (base 2), decimal (base 10), or hexadecimal (base 16). Enter the number and its source and destination bases to get the equivalent value; the steps below explain how to use a calculator that has base-conversion mode and what to do if yours does not.

Formula

For a numeral with digits dk through d0 in base b, its decimal value is the sum of each digit multiplied by its place value: N = dkbk + dk−1bk−1 + … + d0b0. To convert that value into a target base t, repeatedly divide the decimal integer by t and read the remainders from last to first. Here, b is the source base, t is the target base, and each digit must be a valid digit in its base. This calculator block demonstrates converting the default decimal value 42 to base 2; it uses the conversion identity expressed by the input values.

Worked Example

Using the exact defaults in the calculator block:

  1. Read the input as 42 in base 10. Decimal notation uses digits 0 through 9.
  2. Divide 42 by the target base, 2. The quotient is 21 and the remainder is 0.
  3. Divide 21 by 2. The quotient is 10 and the remainder is 1.
  4. Divide 10 by 2. The quotient is 5 and the remainder is 0.
  5. Divide 5 by 2. The quotient is 2 and the remainder is 1.
  6. Divide 2 by 2. The quotient is 1 and the remainder is 0. Divide 1 by 2 to get quotient 0 and remainder 1.
  7. Read the remainders from bottom to top: 101010. Therefore, 4210 = 1010102.

Check by place value: 1×25 + 0×24 + 1×23 + 0×22 + 1×21 + 0×20 = 32 + 8 + 2 = 42.

Assumptions

  • The example and calculator block handle nonnegative whole numbers, not fractions or negative values.
  • The entered numeral is valid for its stated source base. The calculator block treats the number field as a decimal numeric value and is a simple demonstration; for general base conversion, use a calculator with dedicated base-n input and output fields.
  • Base values are limited to 2 through 36. In bases above 10, letters usually represent digit values 10 through 35.

What You’ll Need

  • A calculator with a base-n, base conversion, or programmer mode. A scientific or programmer calculator may offer this under a mode menu.
  • The number you want to convert and its current base.
  • The base you want to convert to. Common choices are base 2, 8, 10, and 16.

Step-by-Step

  1. Find the base-conversion feature. Look for a key or menu labeled BASE-N, BASE, or Programmer. The exact menu path differs by calculator. Some models call the modes BIN, OCT, DEC, and HEX for binary, octal, decimal, and hexadecimal.
  2. Choose the source base. Select the base in which your original number is written before entering it. If your device uses mode keys, choose the matching mode, such as DEC for decimal or HEX for hexadecimal.
  3. Enter the number carefully. Type the digits in their written order. In hexadecimal, A usually means 10, B means 11, and so on through F for 15. Some calculators use dedicated letter keys or a shift function. Confirm how your model enters these digits.
  4. Choose the destination base. Select the output base, such as BIN for binary or DEC for decimal. Some calculators convert immediately when you change the mode; others require an equals, convert, or base key.
  5. Read the full result. Check that the display is labeled with the intended base. If the result is longer than the screen, scroll or use the calculator’s answer recall function. Copy all digits, including leading zeros if your task requires a fixed-width representation.
  6. Check the conversion. Convert the result back to the original base or evaluate its place-value sum. For example, binary 101010 equals 32 + 8 + 2 = 42 in decimal.
  7. Clear before another conversion. Return to the correct source-base mode and clear the previous entry so that leftover digits or settings do not affect the next calculation.

Common Mistakes

  • Setting the wrong source base: The digits 10 mean ten in decimal but two in binary. Select the input base before typing.
  • Typing an invalid digit: A base can only use digits with values below that base. For example, 2 is not valid in base 2, and G is not valid in hexadecimal.
  • Confusing a digit with its value: In base 16, the digit A represents ten, not the decimal number formed by the characters “1” and “0.”
  • Reading a result in the wrong mode: A display of 1010 could mean binary ten or decimal one thousand ten. Check the selected base indicator.
  • Rounding or truncating: Some calculators handle only integers in base mode. Fractional conversions may be rounded or omitted, so confirm the device’s behavior before relying on a decimal result.

Tips

  • Use a small test value to learn your calculator’s controls. For example, decimal 10 should become binary 1010, octal 12, and hexadecimal A.
  • Write base information as a subscript or label, such as 10102 and 1010, to avoid ambiguity.
  • For manual checks, convert a numeral to decimal using place values. Then convert the decimal integer to the new base by repeated division and reverse the remainders.
  • When working with computer data, distinguish the numeral’s value from its storage width. A calculator may omit leading zeros even when a file format requires them.
  • Use the calculator manual for key sequences and supported features; button layouts and fraction handling vary by model.

Troubleshooting

  • An error appears: Check that every digit is allowed in the source base and that the base is supported. Clear the entry and try again.
  • The answer seems much too large or small: Verify the source mode. A decimal number accidentally read as binary, or vice versa, changes its value substantially.
  • The calculator rejects letters: Check for a hexadecimal digit-entry function, often accessed by a shift key, or use a dedicated base converter that accepts A–F.
  • The display is blank, incomplete, or rounded: Check whether the model supports that base and whether it has a digit limit. For fractions or long values, use a tool that documents its precision and conversion rules.
  • The menu names do not match: Search the manual for “number base,” “base conversion,” or “programmer mode.” If the calculator has no such feature, use repeated division for integer conversion or a suitable base-conversion tool.

Frequently Asked Questions

What does base n mean?
It means a number system with n distinct digit values, from 0 through n−1. Base 2 uses 0 and 1; base 10 uses 0 through 9.

How do I convert decimal to binary on a calculator?
Select decimal as the input and binary as the output, enter the decimal number, then use the calculator’s convert or equals function. For 42, the binary result is 101010.

How do I convert binary to decimal?
Select binary as the source, enter only 0s and 1s, and choose decimal as the destination. You can check by adding each bit multiplied by its corresponding power of 2.

Can a base-n calculator convert fractions?
Some can, but support varies. A device may convert only the integer part, round the fraction, or show a repeating expansion. Check the manual and the displayed precision.

Why does hexadecimal use letters?
Base 16 needs sixteen digit values. Since ordinary decimal digits provide only ten, A through F commonly represent values 10 through 15.

What if my calculator has no base mode?
For whole numbers, convert to decimal with place values, then repeatedly divide by the target base and reverse the remainders. A base-conversion calculator can do both stages for you.

Related

Formula used
in value | Number to convert | - | 42 | 0
in source | Source base | - | 10 | 2 | 36
in target | Target base | - | 2 | 2 | 36
out converted | Converted value in target base | - | value | 0

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →