Hex Calculator
Convert between hexadecimal and decimal, add and subtract hex numbers with our free hex calculator
Available Calculators
What is Hexadecimal?
Hexadecimal (hex) is a base-16 number system that uses 16 digits: 0-9 and A-F. It's widely used in computing because it's more compact than binary and easier to read. Each hex digit represents 4 bits, making it perfect for representing binary data in a human-readable format.
Hexadecimal Conversion
Converting between hexadecimal and decimal is essential in computer science and programming. Hex to decimal conversion involves multiplying each digit by its corresponding power of 16, while decimal to hex uses repeated division by 16.
Hex to Decimal Formula
To convert hex to decimal, multiply each digit by 16 raised to its position power:
Decimal to Hex Formula
To convert decimal to hex, repeatedly divide by 16 and collect remainders. Convert remainders 10-15 to A-F, then read from bottom to top.
Examples of Hex Calculations
Here are several everyday situations that show how easy it is to use our hex calculator.
Example 1: Hex to Decimal
Convert the hex number FF to decimal.
Example 1: Hex to Decimal
Convert the hex number FF to decimal.
You can use our calculator by entering:
What is FF₁₆ in decimal?
The calculator returns: 255
The formula used is:
Example 2: Decimal to Hex
Convert the decimal number 255 to hex.
Example 2: Decimal to Hex
Convert the decimal number 255 to hex.
You can use our calculator by entering:
What is 255₁₀ in hex?
The calculator returns: FF
The formula used is:
Example 3: Hex Addition
Add two hex numbers: FF + 0A.
Example 3: Hex Addition
Add two hex numbers: FF + 0A.
You can use our calculator by entering:
What is FF₁₆ + 0A₁₆?
The calculator returns: 109
The formula used is:
Example 4: Hex Subtraction
Subtract hex numbers: FF - 0A.
Example 4: Hex Subtraction
Subtract hex numbers: FF - 0A.
You can use our calculator by entering:
What is FF₁₆ - 0A₁₆?
The calculator returns: F5
The formula used is:
Example 5: RGB Color Code
Convert the RGB color code #FF0000 (red) to decimal values.
Example 5: RGB Color Code
Convert the RGB color code #FF0000 (red) to decimal values.
You can use our calculator by entering:
What is FF₁₆ in decimal for the red component?
The calculator returns: 255
The formula used is:
Example 6: Memory Address
Convert the memory address 0x1000 to decimal.
Example 6: Memory Address
Convert the memory address 0x1000 to decimal.
You can use our calculator by entering:
What is 1000₁₆ in decimal?
The calculator returns: 4096
The formula used is:
Example 7: MAC Address
Convert the first octet of a MAC address 0A to decimal.
Example 7: MAC Address
Convert the first octet of a MAC address 0A to decimal.
You can use our calculator by entering:
What is 0A₁₆ in decimal?
The calculator returns: 10
The formula used is:
Example 8: Unicode Character
Convert the Unicode code point U+0041 (letter 'A') to decimal.
Example 8: Unicode Character
Convert the Unicode code point U+0041 (letter 'A') to decimal.
You can use our calculator by entering:
What is 41₁₆ in decimal?
The calculator returns: 65
The formula used is:
Example 9: File Permissions
Convert the Unix file permission 755 (octal) to hex. First convert to decimal: 755₈ = 493₁₀.
Example 9: File Permissions
Convert the Unix file permission 755 (octal) to hex. First convert to decimal: 755₈ = 493₁₀.
You can use our calculator by entering:
What is 493₁₀ in hex?
The calculator returns: 1ED
The formula used is:
Example 10: Network Configuration
Add two hex subnet masks: FF + FF.
Example 10: Network Configuration
Add two hex subnet masks: FF + FF.
You can use our calculator by entering:
What is FF₁₆ + FF₁₆?
The calculator returns: 1FE
The formula used is:
Summary
These examples show how our hex calculator can handle:
- •Hex to decimal conversion (FF₁₆ = 255₁₀)
- •Decimal to hex conversion (255₁₀ = FF₁₆)
- •Hex addition (FF₁₆ + 0A₁₆ = 109₁₆)
- •Hex subtraction and color code applications
You can adapt any real-life situation involving hex numbers to one of these patterns and let the calculator do the work for you.
How to Use
- Select the type of hex calculation you need (hex to decimal, decimal to hex, hex addition, or hex subtraction).
- Enter the required values in the input fields. The calculator will automatically update results in real-time.
- View the result and step-by-step calculation breakdown with formulas displayed using mathematical notation.
Frequently asked questions
How do I convert hex to decimal?
To convert hex to decimal, multiply each digit by its corresponding power of 16 and sum the results. For example, FF₁₆ = 15×16¹ + 15×16⁰ = 240 + 15 = 255₁₀.
How do I convert decimal to hex?
To convert decimal to hex, repeatedly divide by 16 and collect the remainders. Convert remainders 10-15 to A-F, then read from bottom to top.
Related tools
- Binary Calculator
Convert between binary and decimal, add and subtract binary numbers with our free binary calculator
- Binary Converter
Instantly convert between decimal, binary, octal and hexadecimal number systems with two's complement support.
- Scientific Calculator
Advanced scientific calculator with trigonometric, logarithmic, and exponential functions
About this tool
Published by Online Tools CenterLast updated:
Check the units, assumptions and rounding before using a result. Health and financial estimates are educational and do not replace individual professional advice.
Found an error? Send the tool name, inputs, expected result and actual result so we can investigate.
Report a problem