A hexadecimal base calculator converts numbers between base 16 and other number systems, most often decimal (base 10), binary (base 2), and octal (base 8). Enter a valid number and choose its source and destination bases to see the converted value; hexadecimal uses digits 0–9 and letters A–F.
Formula
This calculator’s conversion rule is positional notation: interpret the entered digits using the selected source base, then express the same value using the destination base. For a source number with digits dk through d0, its decimal value is the sum of each digit multiplied by its place value:
Decimal value = dk × bk + … + d1 × b1 + d0 × b0
Here, b is the source base, and each digit’s value must be less than b. In hexadecimal, A=10, B=11, C=12, D=13, E=14, and F=15. To convert that decimal value to a destination base, repeatedly divide by the destination base and read the remainders from last to first. The input x is a nonnegative whole number written in the selected source base; from and to are the chosen bases. The output is the equivalent numeral in the destination base. The calculator accepts integer inputs, not fractions or signed values.
Worked Example
Using the defaults, convert hexadecimal 2A to decimal. The digit A represents 10:
2A16 = 2 × 161 + 10 × 160
= 2 × 16 + 10 × 1
= 32 + 10
= 4210
The default destination is hexadecimal, so the calculator expresses 42 in base 16. Divide by 16: 42 = 2 × 16 + 10. The quotient is 2 and the remainder 10 corresponds to A. Reading the remainder after the quotient gives 2A16. The result is therefore 2A, as shown by the calculator. To see the decimal value, select Decimal as the destination; the result is 42.
What Hexadecimal Means
Hexadecimal, often shortened to “hex,” is a positional numeral system with base 16. Each position represents a power of 16, just as decimal positions represent powers of 10. Hexadecimal needs sixteen symbols for single-digit values, so it uses the ordinary numerals 0 through 9 followed by A through F. Letter case does not change the value: 2a and 2A both mean forty-two in decimal.
Hex is useful in computing because one hexadecimal digit corresponds exactly to four binary digits. For example, the binary group 1010 equals decimal 10, so it is written as A in hex. Grouping a binary number into sets of four bits makes long strings easier to read without changing their underlying value. A leading 0 is often omitted because it does not change a number’s value.
How to Use the Calculator
- Enter the numeral using only digits allowed by the source base. For hexadecimal, use 0–9 and A–F; letters can usually be entered in either case.
- Choose the base the number is currently written in, then select the base you want for the answer.
- Read the converted numeral. If you need to document the result, label its base—for example, 4210 or 2A16—because the same digits can mean different values in different bases.
The sample input is 2A, so it is valid in hexadecimal but not in decimal: decimal numbers cannot contain A. Similarly, the binary number 102 is invalid because binary permits only 0 and 1. The calculator should reject digits that are not valid for the selected source base rather than guess what they mean.
Conversions and Useful Checks
For hex-to-decimal conversion, multiply each digit by its place value and add. For example, 3F16 = 3 × 16 + 15 = 6310. For decimal-to-hex conversion, divide by 16 repeatedly. To convert 255, the first division is 255 = 15 × 16 + 15; both remainders are F, so 25510 = FF16.
Hex-to-binary conversion can be done digit by digit by replacing each hex digit with its four-bit equivalent: 2A16 becomes 0010 10102, or 1010102 after dropping leading zeroes. Binary-to-hex uses the reverse process: group bits from the right into fours, padding the leftmost group with zeroes if needed. Octal works similarly with groups of three binary bits, since 8 = 23.
- Check with a round trip: convert the answer back to the original base. It should reproduce the starting value, apart from harmless leading zeroes or letter case.
- Check digit limits: a base-b numeral cannot contain a digit whose value is b or greater. Thus F is valid in base 16 but not base 15.
- Keep the base visible: “10” means ten in decimal, sixteen in hexadecimal, and two in binary.
Common Mistakes and Limitations
A frequent error is treating hexadecimal letters as separate labels instead of digit values. A is ten, not one; consequently, 1A16 is 1 × 16 + 10 = 26, not 20. Another is mixing up the input base and output base: selecting Decimal as the source for “2A” makes the input invalid, even though 2A is a valid hexadecimal numeral.
This calculator is intended for nonnegative integers. Decimal fractions require a separate method for converting digits after the radix point, while negative numbers need a sign convention. In computer systems, negative integers are often represented with fixed-width two’s-complement encoding; that is not the same thing as simply putting a minus sign in front of a base conversion. Likewise, a hexadecimal color code or memory address may have a fixed number of digits that carries formatting or data-structure meaning. Converting its numeric value does not preserve that formatting.
Very long inputs may exceed a calculator’s supported input length or the exact integer precision of some software. For critical work, use a tool that documents its integer limits, and retain the original string if leading zeroes or fixed-width representation matter.
Frequently Asked Questions
How do I convert hex to decimal?
Multiply every digit by the corresponding power of 16, starting with 160 at the right, then add the products. For example, 2A16 = 2 × 16 + 10 = 4210.
What does A mean in hexadecimal?
A represents decimal 10. The remaining letters continue in order: B is 11, C is 12, D is 13, E is 14, and F is 15.
Is 10 the same in hex and decimal?
No. 1010 means ten, while 1016 means one group of sixteen, or 16 in decimal. Always identify the base when a numeral could be ambiguous.
How do I convert hexadecimal to binary?
Replace each hexadecimal digit with its four-bit binary equivalent. For example, 2A becomes 0010 1010; remove leading zeroes if a compact binary numeral is preferred.
Can a hexadecimal calculator convert fractions?
This calculator handles whole numbers. Fractional values can be converted by multiplying the fractional part by the target base repeatedly and recording the integer parts, but the expansion may continue indefinitely or require rounding.
Related
Formula used
in x | Number to convert | - | 2A | 0 sel from | Source base | Binary=2, Octal=8, Decimal=10, Hexadecimal=16 sel to | Destination base | Binary=2, Octal=8, Decimal=10, Hexadecimal=16 out result | Converted value | base | x | 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
- How to Find the Continuous Decay Rate
- Total Constant of Decay: How to Calculate It0.000121 1/s
- How to Calculate Decay Constant0.000121 1/s
- Half Life GitHub: What It Is and How to Use It
- Decay Constant: How to Calculate It0.000121 1/s
- Half-Life Games in Order: Full Release Timeline