Introduction
A hex calculator lets you do math with hexadecimal numbers. Hexadecimal, or "hex" for short, is a base-16 number system. It uses the digits 0 through 9 and the letters A through F to represent values. The letter A stands for 10, B stands for 11, and so on up to F, which stands for 15. Hex numbers are used a lot in computer science, coding, and digital electronics because they are a short way to write long binary numbers.
With this hex calculator, you can add, subtract, multiply, and divide hexadecimal numbers quickly and easily. Instead of converting hex to decimal, doing the math, and then converting back, this tool does all the work for you in seconds. Whether you are a student learning about number systems or a programmer working with color codes and memory addresses, this calculator saves you time and helps you avoid mistakes.
How to Use Our Hex Calculator
Enter hexadecimal values and choose an operation to get instant results in hex, decimal, and binary. You can also convert numbers between bases and view a full reference table.
Field A (Hex): Type your first hexadecimal number into this field. Use the digits 0–9 and the letters A–F. For example, you could type "1A2B3C" or "8AB". This is the starting value for your calculation.
Operation: Pick what you want to do with your numbers from the dropdown menu. You can choose from basic math like addition (+), subtraction (−), multiplication (×), division (÷), modulo (mod), and exponent (^). You can also pick bitwise operations like AND, OR, NOT, XOR, left shift (<<), and right shift (>>).
Field B (Hex or Integer): Type your second hexadecimal number here. If you chose left shift, right shift, or exponent as your operation, this field accepts a plain integer instead of a hex value. This field hides when you select the NOT operation since NOT only needs one input.
Group Digits Toggle: Turn this switch on or off to control how the results look. When it is on, spaces and commas are added to hex, binary, and decimal results so long numbers are easier to read.
Results: After you click the equals button or type a value, the calculator shows your answer in three formats at once — hexadecimal (base 16), decimal (base 10), and binary (base 2). Use the Copy button next to any result to copy it to your clipboard.
Calculation Steps: Below the results, you will see a step-by-step breakdown of how the answer was found. Each step shows the conversion and math so you can follow along and learn how hex arithmetic works.
Number Base Converter: Use this section to convert any single number between hexadecimal, decimal, octal, and binary. Type a number in the input field, pick the base it is currently in, and the tool instantly shows its value in all four bases. Press the swap button to quickly flip the "From" and "To" bases.
Hex / Decimal / Binary Reference Table: Scroll through this table to look up every value from 0 to 255. Each row shows the hex, decimal, octal, binary, and ASCII character for that number, making it a handy quick-reference guide.
Bit Visualization of Result: This bar chart breaks your result into nibbles (groups of 4 bits). Each bar shows the nibble's value from 0 to F, giving you a visual picture of how the bits are arranged in your answer.
Hex Calculator
Hexadecimal (or "hex" for short) is a base-16 number system. While the decimal system we use every day has 10 digits (0–9), hex uses 16 symbols: the digits 0–9 plus the letters A–F. The letter A stands for 10, B for 11, C for 12, D for 13, E for 14, and F for 15. Each single hex digit represents exactly four binary bits, which is why programmers and engineers rely on it so heavily — it's a compact, human-friendly way to read and write binary data.
Why Hexadecimal Matters
Computers store and process everything in binary (base-2), which means long strings of 1s and 0s. Reading raw binary is slow and error-prone. Hex solves this by shrinking those long binary strings into something much shorter. For example, the binary number 11111111 becomes just FF in hex. That's why you'll see hex values in color codes (like #FF5733), memory addresses, MAC addresses, and many areas of programming. Network engineers working with subnet calculations or CIDR notation also frequently encounter hex when examining IP addresses at the binary level.
How Hex Arithmetic Works
Hex arithmetic follows the same rules as decimal math — addition, subtraction, multiplication, and division — but you carry and borrow at 16 instead of 10. For instance, if you add hex A + 6, you get 10 in hex (which equals 16 in decimal). The calculator above handles these operations for you and shows each step so you can follow along. If you need to work with percentages or decimal-based math alongside your hex work, you can convert your hex result to decimal first using the base converter section.
Bitwise Operations Explained
Beyond basic arithmetic, this calculator also supports bitwise operations. These work directly on the binary bits of a number and are essential in computer science:
- AND (&) — Returns a 1 bit only where both inputs have a 1.
- OR (|) — Returns a 1 bit where either input has a 1.
- XOR (⊕) — Returns a 1 bit where the inputs differ.
- NOT (~) — Flips every bit: 1 becomes 0 and 0 becomes 1.
- Left Shift (<<) — Moves all bits to the left, which multiplies the value by 2 for each shift.
- Right Shift (>>) — Moves all bits to the right, which divides the value by 2 for each shift.
Bitwise operations are widely used in networking tools like VLSM calculators and bandwidth calculators, where subnet masks and address ranges are manipulated at the bit level.
Converting Between Number Bases
The base converter section lets you switch a number between hexadecimal (base-16), decimal (base-10), octal (base-8), and binary (base-2). To convert hex to decimal by hand, you multiply each digit by its place value (a power of 16) and add the results together. For example, hex 1F equals (1 × 16) + (15 × 1) = 31 in decimal. Going the other way, you divide the decimal number by 16 repeatedly and record the remainders. If you work with other specialized number formats, you might also find our scientific notation calculator or decimal to fraction calculator useful for converting between representations.
Reading the Reference Table
The reference table at the bottom shows every value from 0 to 255 in hex, decimal, octal, and binary, along with its ASCII character. This range (00 to FF in hex) represents one full byte — the basic unit of data in computing. It's a handy quick-lookup when you're working with raw data, character encoding, or debugging code. For related number theory tasks like finding common factors or multiples of the decimal equivalents, check out the GCF calculator or LCM calculator. You can also explore prime factorization to break decimal values down into their prime components.