Hex Calculator

Add, subtract, multiply and divide hexadecimal numbers, with decimal results.

Enter details

Result

119

Decimal result
281
Inputs in decimal
255 + 26
Binary result
100011001

Formula: Numbers are converted from base 16, calculated, then converted back

Hex Calculator: Hexadecimal Math, Binary & Decimal Guide

Short answer

A hex calculator performs standard arithmetic operations—addition, subtraction, multiplication, and division—directly on base-16 numbers. It translates hexadecimal values into decimal equivalents to compute the answer and displays results in hex, decimal, and binary. For instance, adding hex values FF and 1A yields a hex result of 119, which equals 281 in decimal and 100011001 in binary.

Formula

Value_decimal = Σ (d_i × 16^i); Result_hex = Hex(Value_A [op] Value_B)

Value_decimal converts a hexadecimal string into base 10, where d_i represents the numeric value of each hex digit (0-9 for 0-9, and 10-15 for A-F) and 16^i represents the positional power of 16. The symbol [op] denotes the arithmetic operator (+, -, ×, ÷), and Hex() converts the resulting decimal calculation back into base-16 notation.

Worked example

First number
FF
Operation
+
Second number
1A
  • Result: 119
  • Decimal result: 281
  • Inputs in decimal: 255 + 26
  • Binary result: 100011001

What the Hex Calculator Computes

The Hex Calculator performs standard mathematical operations on base-16 (hexadecimal) numbers. Hexadecimal arithmetic follows the same fundamental principles as base-10 arithmetic, but digits range from 0 to 15 rather than 0 to 9. The digits 10, 11, 12, 13, 14, and 15 are represented by the letters A, B, C, D, E, and F, respectively.

This tool is designed for computer science students, embedded systems engineers, software developers, and network administrators who work with low-level data. It computes addition, subtraction, multiplication, and division while simultaneously outputting the corresponding values in base-10 (decimal) and base-2 (binary). This multi-base output eliminates conversion steps when inspecting memory offsets, color codes, or network packet bytes.


Step-by-Step Worked Example

To understand how hexadecimal operations function, consider the worked example evaluated by the calculator:

  • First number ($a$): FF
  • Operation ($op$): +
  • Second number ($b$): 1A

Step 1: Convert Each Value to Decimal

Each position in a hexadecimal number represents an ascending power of 16, beginning with $16^0$ on the far right.

  • For $FF$: $$\text{Value} = (F \times 16^1) + (F \times 16^0)$$ $$\text{Value} = (15 \times 16) + (15 \times 1) = 240 + 15 = 255$$

  • For $1A$: $$\text{Value} = (1 \times 16^1) + (A \times 16^0)$$ $$\text{Value} = (1 \times 16) + (10 \times 1) = 16 + 10 = 26$$

Step 2: Compute the Sum in Decimal

Add the two decimal values together: $$255 + 26 = 281$$

Step 3: Convert the Decimal Sum Back to Hexadecimal

Divide the decimal sum by 16 repeatedly to find the base-16 digits:

  1. $281 \div 16 = 17$ with a remainder of $9$. (The rightmost digit is 9).
  2. $17 \div 16 = 1$ with a remainder of $1$. (The middle digit is 1).
  3. $1 \div 16 = 0$ with a remainder of $1$. (The leftmost digit is 1).

Reading the remainders from bottom to top yields the hex string 119.

Step 4: Convert to Binary

Each hexadecimal digit maps directly into a 4-bit nibble:

  • 1 in binary is 0001 (or 1 for the leading digit)
  • 1 in binary is 0001
  • 9 in binary is 1001

Concatenating these groups produces the binary value 100011001 (which equals $256 + 16 + 8 + 1 = 281$ in base 10).


How to Read the Results

When you run an operation, the calculator provides four linked outputs:

  • Result (Hexadecimal): The raw calculation in base-16 notation. In our example, this is 119.
  • Decimal Result: The base-10 value of the answer (281). This confirms the standard arithmetic scale of the calculation.
  • Inputs in Decimal: Shows the equivalent base-10 operation (255 + 26), allowing you to audit whether your inputs match your expectations.
  • Binary Result: The base-2 representation (100011001). This string helps you quickly map output values into CPU registers, logic gates, or bitmasks.

Hex to Decimal Value Benchmarks

Familiarity with standard byte boundaries aids in identifying valid calculations quickly:

| Hex Value | Decimal Equivalent | Binary Equivalent | Common Computing Context | | :--- | :--- | :--- | :--- | | 0F | 15 | 00001111 | Maximum value of a single nibble (4 bits) | | 7F | 127 | 01111111 | Maximum signed 8-bit integer | | FF | 255 | 11111111 | Maximum unsigned 8-bit byte (e.g., RGB channels) | | 0FFF | 4,095 | 0000111111111111 | Common 12-bit address space | | FFFF | 65,535 | 1111111111111111 | Maximum unsigned 16-bit word |


Practical Tips for Hex Calculations

  1. Think in Nibbles: Break binary sequences into chunks of four bits starting from the right. A binary string like 11010111 is simply 1101 (D) and 0111 (7), translating immediately to D7 in hex.
  2. Manual Carry Rule: When adding digits manually, remember that $9 + 1 = A$, and $F + 1 = 10_{16}$ (which represents sixteen in decimal, carrying a 1 into the next column).
  3. Web Colors: Hex codes used in CSS represent three 8-bit color channels: #RRGGBB. Performing addition or subtraction on these channels must be done channel by channel to avoid color bleeding across boundary limits.

When Not to Rely on Basic Hex Math

While mathematical hex arithmetic assumes infinite precision, modern microprocessors and memory registers do not. Keep these limitations in mind:

  • Fixed-Width Register Overflow: If you add two 8-bit hex numbers on a microcontroller (e.g., FF + 01), the true mathematical result is 100. In an 8-bit unsigned architecture, the leading 1 overflows, leaving 00 in the register and setting a hardware carry flag.
  • Signed Two's Complement Interpretation: A hex value such as FF can mean positive 255 in an unsigned context, or negative 1 (-1) in a signed 8-bit integer context. Standard hex arithmetic calculators treat numbers as positive values unless an explicit negative sign or signed two's complement mode is applied.

Comparison

ScenarioInputResult
Base exampleFirst number: FF; Operation: +; Second number: 1AResult: 119

Common mistakes

  • Carrying over 10 instead of 16 during manual addition or borrowing 10 instead of 16 during subtraction.
  • Confusing the letter values, such as mistaking B (decimal 11) for D (decimal 13) or treating F as 16 instead of 15.
  • Entering non-hex characters like the letter 'O' instead of the number '0', or letters past 'F'.
  • Ignoring byte boundaries and sign bits, assuming all hex values represent positive integers when working in two's complement systems.
  • Misinterpreting hex string length as magnitude without aligning digit place values.

Checklist

  • Verify that input values contain only valid hexadecimal characters (0–9 and A–F).
  • Confirm whether letter digits are uppercase or lowercase; hex math is case-insensitive, but consistency prevents entry typos.
  • Remember that carrying or borrowing occurs in groups of 16, not groups of 10.
  • Check whether your context requires fixed bit-widths (such as 8-bit, 16-bit, or 32-bit values) that could cause overflow.
  • Cross-reference the decimal equivalent to double-check complex multi-digit calculations.
  • Ensure you are not dividing by zero when performing hexadecimal division.

Calculators Percentage Editorial Team

Calculator guides from the Calculators Percentage team. These introductory examples are educational, not professional advice.

Last reviewed:

This tool and guide are provided for educational and technical reference purposes. Always verify critical memory addresses, register values, and hardware configurations in low-level engineering environments against system specifications.

Frequently Asked Questions

What is the hexadecimal number system?

Hexadecimal is a base-16 positional numeral system. It uses sixteen distinct symbols: numbers 0 through 9 to represent values zero to nine, and letters A through F (or a through f) to represent values ten to fifteen. It is widely used in computing because one hex digit corresponds directly to four binary digits (a nibble).

How do you add two hexadecimal numbers manually?

To add hex numbers, align them by column from right to left. Add the decimal values of the digits in each column. If the sum is 15 or less, write down the corresponding hex digit; if the sum is 16 or greater, subtract 16, write down the remainder, and carry 1 to the next column.

Why do programmers use hexadecimal instead of binary?

Binary strings are long and difficult for humans to read and write without making errors. Because 16 is 2 raised to the 4th power, exactly four binary bits map cleanly to a single hexadecimal digit. A full 8-bit byte can be represented compactly by just two hex digits (e.g., 11111111 in binary is FF in hex).

What decimal value does hex FF represent?

Hexadecimal FF equals 255 in decimal. It is calculated as (15 × 16^1) + (15 × 16^0), which simplifies to 240 + 15 = 255. In computing, FF represents the maximum value that can be stored in an unsigned 8-bit byte.

How does hexadecimal subtraction handle borrowing?

In hexadecimal subtraction, if the top digit is smaller than the bottom digit, you borrow 1 from the next higher column to the left. Because the system is base-16, borrowing 1 adds 16 (not 10) to the current column's value before subtracting.

Can hexadecimal numbers represent negative values?

Yes, hexadecimal values can represent negative numbers using signed representations, most commonly two's complement notation. In an 8-bit signed system, values from 80 to FF represent negative numbers, where FF represents -1.

Sources & references

Formulas are tested against hand-checked answers. How we check our calculators.

Estimates only. Confirm final figures, terms and fees with your bank, provider or a qualified professional.

Last updated: January 15, 2026