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:

h_n h_n-1 ... h_1 h_0 = _i = 0^n h_i × 16^i

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.

You can use our calculator by entering:

What is FF₁₆ in decimal?

The calculator returns: 255

FF₁₆ = 15×16¹ + 15×16⁰
= 240 + 15
= 255₁₀

The formula used is:

FF_16 = 255_10

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

255 ÷ 16 = 15 remainder F
15 ÷ 16 = 0 remainder F
Read remainders from bottom: FF₁₆

The formula used is:

255_10 = FF_16

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

FF₁₆ = 255₁₀
0A₁₆ = 10₁₀
255 + 10 = 265
265₁₀ = 109₁₆

The formula used is:

FF_16 + 0A_16 = 109_16

Example 4: Hex Subtraction

Subtract hex numbers: FF - 0A.

You can use our calculator by entering:

What is FF₁₆ - 0A₁₆?

The calculator returns: F5

FF₁₆ = 255₁₀
0A₁₆ = 10₁₀
255 - 10 = 245
245₁₀ = F5₁₆

The formula used is:

FF_16 - 0A_16 = F5_16

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

FF₁₆ = 15×16¹ + 15×16⁰
= 240 + 15 = 255₁₀
Red component: 255

The formula used is:

FF_16 = 255_10

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

1000₁₆ = 1×16³ + 0×16² + 0×16¹ + 0×16⁰
= 4096 + 0 + 0 + 0 = 4096₁₀

The formula used is:

1000_16 = 4096_10

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

0A₁₆ = 0×16¹ + 10×16⁰
= 0 + 10 = 10₁₀

The formula used is:

0A_16 = 10_10

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

41₁₆ = 4×16¹ + 1×16⁰
= 64 + 1 = 65₁₀

The formula used is:

41_16 = 65_10

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

493 ÷ 16 = 30 remainder D (13)
30 ÷ 16 = 1 remainder E (14)
1 ÷ 16 = 0 remainder 1
Read from bottom: 1ED₁₆

The formula used is:

493_10 = 1ED_16

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

FF₁₆ = 255₁₀
255 + 255 = 510
510₁₀ = 1FE₁₆

The formula used is:

FF_16 + FF_16 = 1FE_16

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

  1. Select the type of hex calculation you need (hex to decimal, decimal to hex, hex addition, or hex subtraction).
  2. Enter the required values in the input fields. The calculator will automatically update results in real-time.
  3. 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.

About this tool

Published by Online Tools Center

Last 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