# Hex Calculator / Converter

Use this tool in **hex calculator** mode to perform algebraic operations with hex numbers (add, subtract, multiply and divide hexadecimals). Use it in **hex converter** mode to easily convert a hex number to a decimal number, or a decimal number to a hex one (decimal to hex and **hex to decimal converter**), or to convert hex to binary and binary to hex.

## What is a hex number?

A hex number, short for **hexadecimal number**, is a number expressed in the hexadecimal positional numeral system with a base of 16 which uses sixteen symbols: the numbers from 0 to 9 and the letters A,B,C,D,E, and F, to represent values from 0 to 15. Equivalently, small-case letters a through f can be used. For example, 10 in decimal is A in hex, 100 in decimal is 64 in hex, while 1,000 in decimal is 3E8 in hex. Hex numbers have signs, just like decimal ones, for example -1e is equal to -30 in decimal.

Hex numerals are used mostly in computing: **computer system designers**, **software engineers** and **programmers** as a convenient representation of the underlying binary systems. People in such occupations are most likely to be in need of a hex calculator or hex converter.

An ordinary person would encounter them every day when browsing the web since in website addresses (URLs) special characters are encoded as a hex numeral, e.g. %20 stands for "space" (blank). A lot of webpages also encode special characters in html in terms of their hexadecimal numerical character reference (&#x*code*), e.g. ’ is the Unicode for a single quotation mark (’). A regular person browsing the web should not require a hexadecimal converter or calculator to do so.

Using our hex calculator, you can perform **arithmetic operations** (addition, subtraction, multiplication and division of hex numbers) as well as use it as a hex converter for **hex to decimal**, **decimal to hex**, **hex to binary** and **binary to hex conversions**.

Here is a table of some numbers represented in the decimal, hex and binary systems (base 10, base 2 and base 16).

Decimal | Hex | Binary |
---|---|---|

0 | 0 | 0 |

1 | 1 | 1 |

2 | 2 | 10 |

3 | 3 | 11 |

5 | 5 | 101 |

10 | A | 1010 |

11 | B | 1011 |

12 | C | 1100 |

13 | D | 1101 |

14 | E | 1110 |

15 | F | 1111 |

50 | 32 | 110010 |

63 | 3F | 111111 |

100 | 64 | 1100100 |

1000 | 3E8 | 1111101000 |

10000 | 2710 | 10011100010000 |

## Converting to and from hex numerals

Converting numbers to and from hex does not change the number itself, it just changes its form. Using our hex converter above, you can do both types of conversions quickly and easily. Note that hex conversion and hex calculation are separate operations and you do not need to perform one in order to perform the other.

### Hex to decimal

Each position in a hexadecimal numeral represents a power of 16 the same way each position in a decimal number represents a power of 10. For example, the number 20 in decimal is 2 · 10^{1} + 0 · 10^{0} = 20. The hex number 20 is then 2 · 16^{1} + 0 · 16^{0} = 32 in dec. Similarly, the number 1E is 1 · 16 + 14 · 1 = 30 in decimal.

The process of hex to decimal conversion is therefore to first take each position and convert it to decimal, e.g. 9 is 9, but B is converted to 11, then to multiply each position by 16 to the power of the position number, counting from right to left and starting at zero. If you need to calculate large exponents like 16^{8} you might find our exponent calculator useful.

### Decimal to hex

This process is a bit more complex as we are going from a higher base to a lower base. Let us say the number we want to convert from decimal to hex is X. Begin by finding the largest power of 16 ≤ X and denote it by E. Then determine how many times the power of 16 found above goes into X, denote it by Z_{1}. Denote the remainder by Y_{1}.

Repeat the above steps using Y_{n} as a starting value until 16 is larger than the remaining value and assign the remainder to the 16^{0} position, then assign each of the values Y_{1...n} to its respective position and you will have your hex value.

**Example dec to hex conversion:** Convert 1000 in decimal to hex.

1.) Largest power E = 2 (16^{2} = 256 ≤ 1000, 16^{3} = 4,096 ≥ 1000)

2.) Z_{1} = 1000 / 16^{2} = 3 (232 remainder); Y_{1} = 232

3.) Largest power E = 1 (16^{1} = 16 ≤ 232, 16^{2} = 256 ≥ 232)

4.) Z_{2} = 232 / 16^{1} = 14 (8 remainder); Y_{2} = 8

5.) 8 < 16; Z_{3} = 8, end.

Combine Z_{1..n} to get 3E8 (14 dec = E hex). You can verify the result using our hex converter.

Hex to decimal and decimal to hex conversion follows the same principles, but with base 2 instead of base 10.

## Algebraic operations with hexadecimal numbers

Using our tool in hexadecimal calculator mode you can perform the four basic arithmetic operations on hex numbers: addition, subtraction, multiplication and division. Therefore it doubles as a hexadecimal addition calculator, hexadecimal subtraction calculator, etc. In order to do the hexadecimal calculations yourself most would prefer using a table for smaller numbers and a base 16 calculator for larger ones. Subtraction works the same way as any other number system, except when borrowing a number you need to borrow a group of 16_{10} instead of 10_{10} as you would with decimals.

## Hexadecimal arithmetic calculation examples

A few examples of using base 16 numbers will be instructional in showing that it works the same as with decimal numbers. First, something simple: add 4_{16} and F_{16}. Adding it results in 3_{16} and a carry of 1_{16} (19_{2} = 16^{1} + **3**) which we simply prepend to 3_{16} to get the result: 13_{16}.

For a more complex addition example let us add the hex numbers 3F_{16} and 64_{16}. Starting from right to left:

- (1) Add 4
_{16}and F_{16}, resulting in 13_{16}, which is**3**and carry 1_{16}_{16}over to the left. - (2) Add 3
_{16}and 6_{16}, then add 1_{16}from the carryover, resulting in**A**._{16} - Write the outcome of (2) and (1) next to each other to get the result is
**A3**._{16}

This is how hex addition works. Other base 16 arithmetic operations are performed in a similarl fashion to their decimal counterparts.

#### Cite this calculator & page

If you'd like to cite this online calculator resource and information as provided on the page, you can use the following citation:

Georgiev G.Z., *"Hex Calculator"*, [online] Available at: https://www.gigacalculator.com/calculators/hexadecimal-calculator.php URL [Accessed Date: 09 May, 2021].

* * Math calculators

Mean Calculator
Median Calculator
Mode Calculator
Mean, Median, Mode Calculator
Geometric Mean Calculator
Harmonic Mean Calculator
Weighted Average Calculator
Exponent Calculator
Hex Calculator
Binary Calculator
Percentage Calculator
Percentage Increase Calculator
Percentage Decrease Calculator
Ratio Calculator
Sequence Calculator
Proportion Calculator
Logarithm Calculator
Antilog Calculator
Square Root Calculator
Cube Root Calculator
Root Calculator
Summation Calculator
Scientific Notation Calculator
Fraction Calculator
Simplify Fractions Calculator
Least Common Multiple Calculator
Least Common Denominator Calculator
Greatest Common Divisor Calculator
Significant Figures Calculator
Standard Form Calculator
*show all*