Hex Calculator
Use this free hex calculator to add, subtract, multiply, divide, and inspect hexadecimal values, with instant results and a full step-by-step breakdown.
Detected as Hexadecimal — 8-bit width, 1 byte
Browse Hex Tools by Category
View all tools →- Hex to DecimalConvert base-16 values like FF into decimal numbers like 255.
- Decimal to HexConvert a decimal number into its hexadecimal equivalent.
- Hex to BinaryConvert hex digits into 4-bit binary groups.
- Binary to HexConvert a binary string into compact hexadecimal.
- Hex to OctalConvert hex values into base-8 octal.
- Octal to HexConvert an octal value into its hexadecimal equivalent.
- Hex to Base36Convert hex into the compact base36 alphanumeric system.
- Base36 to HexConvert a base36 value into its hexadecimal equivalent.
- Hex to Base2Convert hex into base2 (binary) digits.
- Base2 to HexConvert a base2 value into its hexadecimal equivalent.
- Hex to Base8Convert hex into base8 (octal) digits.
- Base8 to HexConvert a base8 value into its hexadecimal equivalent.
- Hex to Base10Convert hex into base10 (decimal) digits.
- Base10 to HexConvert a base10 value into its hexadecimal equivalent.
- Hex to Base16Normalize a hex value — base16 and hex are the same system.
- Base16 to HexNormalize a base16 value into standard hex formatting.
- Hex to Base32Encode hex bytes as RFC 4648 Base32 (TOTP secrets, Crockford IDs).
- Base32 to HexDecode a Base32 string back into raw hex bytes.
- Hex to Base64Encode hex bytes as RFC 4648 Base64 (data URIs, JWTs).
- Base64 to HexDecode a Base64 string back into raw hex bytes.
- Base12 to HexConvert a base12 (dozenal) value into its hexadecimal equivalent.
- Hex CalculatorAdd, subtract, multiply, and divide hex values directly.
- Hex Addition CalculatorAdd two hexadecimal numbers with a full carry-by-carry breakdown.
- Hex Subtraction CalculatorSubtract hex values with a full borrow-by-borrow breakdown.
- Hex Multiplication CalculatorMultiply hex values with a full partial-product breakdown.
- Hex Division CalculatorDivide hex values and see the quotient and remainder.
- Hex Modulo CalculatorFind the remainder of dividing one hex value by another.
- Hex Average CalculatorFind the average of two hex values.
- Hex Power CalculatorRaise a hex value to a power.
- Hex Square CalculatorSquare a hex value.
- Hex Square Root CalculatorFind the square root of a hex value.
- Hex Percentage CalculatorFind what percentage one hex value is of another.
- Hex to Negative DecimalInterpret a hex bit pattern as a signed decimal value.
- Negative Decimal to HexConvert a negative decimal number into two's-complement hex.
- Hex Two's Complement CalculatorFlip a hex value's sign using two's complement.
- Hex One's Complement CalculatorInvert every bit of a hex value.
- Hex Absolute Value CalculatorFind the absolute value of a signed hex bit pattern.
- Hex Signed Integer CalculatorRead hex as an int8/int16/int32/int64 signed value.
- Signed Integer to HexEncode a signed integer type as its hex bit pattern.
- Hex Unsigned Integer CalculatorRead hex as a uint8/uint16/uint32/uint64 value.
- Hex Negative Number CalculatorCheck whether a hex value is negative at a given bit width.
- Hex to ASCIITurn hex byte pairs into readable ASCII text.
- ASCII to HexConvert text into its hexadecimal byte representation.
- Hex to UTF-8Decode hex bytes as UTF-8 encoded text.
- UTF-8 to HexEncode text, including emoji, as UTF-8 hex bytes.
- Hex to UnicodeLook up which character a Unicode code point represents.
- Unicode to HexFind a character's Unicode code point in hex.
- Hex to UTF-16Decode hex bytes as UTF-16 text.
- UTF-16 to HexEncode text as UTF-16 hex bytes.
- Hex to UTF-32Decode hex bytes as UTF-32 text.
- UTF-32 to HexEncode text as fixed 4-byte UTF-32 hex.
- Hex to EBCDICDecode hex bytes using IBM mainframe EBCDIC (CP037).
- EBCDIC to HexEncode text into EBCDIC (CP037) hex bytes.
- Hex to BCDFind the binary-coded-decimal form of a hex value.
- BCD to HexConvert a packed decimal (BCD) value into hex.
- Hex to TextConvert a hex value back into plain text.
- Text to HexConvert any text into hexadecimal.
- Hex String to TextDecode a hex string like bytes.fromhex() input.
- Text to Hex StringTurn text into a hex string in the format code expects.
- Hex Bytes to TextDecode a raw byte array shown in hex.
- Text to Hex BytesTurn text into its raw byte array in hex.
- Hex to CharacterLook up which single character a hex byte represents.
- Character to HexFind the hex byte value of a single character.
- Hex Escape ConverterConvert text into \xHH escape-sequence notation.
- Hexadecimal Escape DecoderDecode \xHH escape sequences back into text.
- Hex to RGBConvert a hex color code like #2563EB into RGB values.
- RGB to HexConvert RGB values into a 6-digit hex color code.
- Hex to RGBAConvert a hex color into RGB values plus an alpha channel.
- RGBA to HexConvert RGBA values into an 8-digit hex-with-alpha code.
- Hex to HSLConvert a hex color into hue, saturation, and lightness.
- HSL to HexConvert HSL values into a 6-digit hex color code.
- Hex to HSVConvert a hex color into hue, saturation, and value.
- HSV to HexConvert HSV values into a 6-digit hex color code.
- Hex to HSBConvert a hex color into hue, saturation, and brightness.
- HSB to HexConvert HSB values into a 6-digit hex color code.
- Hex to CMYKConvert a hex color into print-ready CMYK values.
- CMYK to HexConvert CMYK values into a 6-digit hex color code.
- Hex to OKLCHConvert a hex color into the perceptually uniform OKLCH space.
- OKLCH to HexConvert OKLCH values into a 6-digit hex color code.
- Hex to OKLabConvert a hex color into the OKLab color space.
- OKLab to HexConvert OKLab values into a 6-digit hex color code.
- Hex to TailwindConvert a hex color into Tailwind's arbitrary value syntax.
- Tailwind to HexExtract a hex color from a Tailwind arbitrary value class.
- Hex to BootstrapFind the closest Bootstrap 5 theme color to a hex value.
- Bootstrap to HexConvert a Bootstrap theme color name into hex.
- Hex to Material DesignFind the closest Material Design 500-tier color to a hex value.
- Material Design to HexConvert a Material Design color name into hex.
- Hex to UIColorConvert a hex color into iOS UIKit's UIColor syntax.
- UIColor to HexConvert a UIColor call into a hex color code.
- Hex to SwiftUI ColorConvert a hex color into SwiftUI's Color syntax.
- Hex to Jetpack Compose ColorConvert a hex color into Jetpack Compose's Color syntax.
- Hex to CSS ColorFind the standard CSS named color for an exact hex match.
- CSS Color to HexConvert a CSS named color like cornflowerblue into hex.
- Hex Color Tint CalculatorLighten a hex color by blending it toward white.
- Hex Color Difference CalculatorMeasure the perceptual distance between two hex colors.
- Hex Color Opacity CalculatorConvert a hex color and opacity percentage into rgba() and hex8.
- Hex Bitwise CalculatorRun AND, OR, XOR, and NOT on hex values with aligned binary output.
- Hex AND CalculatorBitwise AND two hex values, bit by bit.
- Hex OR CalculatorBitwise OR two hex values, bit by bit.
- Hex XOR CalculatorBitwise XOR two hex values, bit by bit.
- Hex NOT CalculatorBitwise NOT (invert) a hex value at your chosen bit width
- Hex NAND CalculatorBitwise NAND (NOT AND) two hex values
- Hex NOR CalculatorBitwise NOR (NOT OR) two hex values
- Hex XNOR CalculatorBitwise XNOR (NOT XOR) two hex values
- Hex Shift CalculatorShift a hex value left or right by any amount, with logical and arithmetic right-shift modes.
- Hex Left Shift CalculatorShift a hex value left by any amount
- Hex Right Shift CalculatorShift a hex value right by any amount, in either logical or arithmetic mode.
- Hex Arithmetic Shift CalculatorArithmetic right-shift a hex value, preserving its sign bit
- Hex Logical Shift CalculatorLogically shift a hex value left or right, always filling vacated bits with 0
- Hex Rotate Left CalculatorRotate a hex value's bits left by any amount
- Hex Rotate Right CalculatorRotate a hex value's bits right by any amount
- Hex Bit Mask CalculatorBuild a hex bitmask covering a specific bit range
- Hex Bit Set CalculatorSet a specific bit of a hex value to 1 by its index
- Hex Bit Clear CalculatorClear a specific bit of a hex value to 0 by its index
- Hex Bit Toggle CalculatorFlip a specific bit of a hex value by its index
- Hex Bit Count CalculatorCount how many bits are set to 1 in a hex value (popcount) at your chosen bit width.
- Hex CRC CalculatorCompute a CRC checksum from hex or byte input.
- Hex CRC32 CalculatorCompute the CRC32 checksum used in ZIP and PNG formats.
- Hex Checksum CalculatorCompute a simple additive checksum over hex bytes.
- Hex CRC16 CalculatorCompute the CRC-16/MODBUS checksum from hex byte input
- Hex CRC8 CalculatorCompute a CRC8 checksum (polynomial 0x07) from hex byte input
- Hexadecimal Checksum CalculatorCompute an 8-bit additive checksum over a sequence of hexadecimal bytes
- Hex XOR Checksum CalculatorCompute an XOR checksum by XORing every byte of a hex sequence together
- Hex LRC CalculatorCompute the LRC (Longitudinal Redundancy Check) of a hex byte sequence
- Hex Two's Complement Checksum CalculatorCompute a two's-complement checksum: sum the bytes, then take the two's complement of the result
- Hex to IPConvert a hex value into a dotted IPv4 address.
- IP to HexConvert an IPv4 address into its hexadecimal form.
- Hex to MAC AddressFormat a hex string as a MAC address.
- Hex to IPv4 ConverterConvert an 8-digit hex value into a dotted IPv4 address
- IPv4 to Hex ConverterConvert a dotted IPv4 address into its 8-digit hexadecimal form
- Hex to IPv6 ConverterConvert a 32-digit hex value into a standard, compressed IPv6 address
- IPv6 to Hex ConverterConvert a standard IPv6 address, including compressed :: notation, into its full 32-digit hex form.
- MAC Address to Hex ConverterStrip the separators from a MAC address and get its raw 12-digit hex form
- MAC Address to Decimal ConverterConvert a MAC address into a single 48-bit decimal number
- MAC Address to Binary ConverterConvert a MAC address into its 48-bit binary representation, shown byte by byte
- Hex Network Byte Order ConverterConvert a hex value from host byte order to network byte order (big-endian)
- Hex Little Endian IP ConverterConvert a dotted IPv4 address into hex, then reverse the byte order to little-endian
- IPv4 Hex ConverterConvert a dotted IPv4 address into its 8-digit hex form
- Hex Little Endian ConverterReverse byte order to convert big-endian hex to little-endian.
- Hex Big Endian ConverterReverse byte order to convert little-endian hex to big-endian.
- Little Endian Hex to Decimal ConverterInterpret hex bytes stored in little-endian order and get their decimal value
- Decimal to Little Endian Hex ConverterConvert a decimal number into little-endian hex bytes
- Hex to Little Endian ConverterConvert a hex value to little-endian byte order
- Hex to Big Endian ConverterConvert a hex value to big-endian byte order
- Reverse Hex BytesReverse the byte order of a hex value
- Hex Byte SwapSwap the byte order of a hex value
- Hex Endianness ConverterConvert a hex value between big-endian and little-endian
- 16-bit Hex Endian ConverterSwap the byte order of a 16-bit (2-byte) hex value
- 32-bit Hex Endian ConverterSwap the byte order of a 32-bit (4-byte) hex value
- 64-bit Hex Endian ConverterSwap the byte order of a 64-bit (8-byte) hex value
- Hex to DateDecode a hex timestamp into a readable date.
- Date to HexConvert a date into its hex Unix timestamp.
- Hex Timestamp ConverterConvert between hex and Unix timestamps.
- Hex Unix Timestamp ConverterConvert a hex Unix timestamp into its plain decimal seconds value
- Unix Timestamp to Hex ConverterConvert a decimal Unix timestamp into its 8-digit hex form
- Hex Epoch ConverterConvert a hex epoch value into its plain decimal seconds count
- Hexadecimal Timestamp ConverterConvert a decimal Unix timestamp into hexadecimal
- Hex to Python IntegerConvert hex into a Python int literal.
- Hex to JavaScript NumberConvert hex into a JavaScript number.
- Hex to C IntegerConvert hex into a C integer literal.
- Hex to C++ Integer ConverterConvert a hex value into a C++ integer literal
- Hex to Int in C# ConverterConvert a hex value into a C# integer literal
- Int to Hex in C# ConverterConvert a C# int to its hexadecimal string form
- Hex to Java Integer ConverterConvert a hex value into a Java int literal
- Java Integer to Hex ConverterConvert a Java int to its hexadecimal string form
- Hex to PHP Integer ConverterConvert a hex value into a PHP integer literal
- PHP Integer to Hex ConverterConvert a PHP integer to its hexadecimal string form
- Hex to Rust Integer ConverterConvert a hex value into a Rust integer literal
- Rust Integer to Hex ConverterConvert a Rust integer to its hexadecimal string form
- Hex to Go Integer ConverterConvert a hex value into a Go integer literal
- Go Integer to Hex ConverterConvert a Go integer to its hexadecimal string form
- Hex to Decimal in AWKConvert a hex value to decimal, with the exact gawk strtonum() syntax
- Hex to 7-Segment Display ConverterConvert hex digits into their 7-segment display encoding
- JavaScript Number to Hex ConverterConvert a JavaScript number to its hexadecimal string form
- Python Integer to Hex ConverterConvert a Python int to its hexadecimal form
- Hexadecimal TableFull 0-255 hex, decimal, and binary lookup table.
- ASCII Hex TableASCII characters with their hex and decimal codes.
- Common Hex ValuesFrequently used hex constants like 0xFF and 0x7F, explained.
- Hex to Binary TableA focused hex/binary-only lookup table, 0-255.
- Hex to Decimal TableA focused hex/decimal-only lookup table, 0-255.
- Hexadecimal 0-255 ConverterEnter any byte and see its full breakdown in every base at once.
- Hexadecimal 0-255 ChartEvery byte value laid out in a 16x16 visual grid.
- Hexadecimal Conversion ChartHex place values and single-digit mappings, the core facts behind every conversion.
Introduction to the Hexadecimal System
Hexadecimal is a base-16 number system that uses sixteen digits: 0 through 9, then A through F for 10 through 15. Each hex digit maps to exactly four binary bits, so two hex digits represent one byte — that's why hex shows up everywhere in programming, memory addresses, color codes, and networking. A hex calculator like this one converts and computes those values instantly, without doing the base conversion by hand.
Further reading: Hexadecimal — Wikipedia
Watch: How Hexadecimal Works
“Understanding Binary, Hexadecimal, Decimal (Base-10), and more” by Corey Schafer on YouTube.
What Is a Hexadecimal Calculator?
A hex calculator performs arithmetic — addition, subtraction, multiplication, and division — directly on base-16 values, and converts the result into decimal, binary, and octal at the same time. It checks manual hex math, helps with debugging, and converts between number systems without doing the base conversion by hand.
How Does the Calculator Work?
- Enter one or two hex values.
- Choose an operation to calculate, or switch to Convert / Inspect for one value.
- Read the result in hex, decimal, binary, and octal, plus a step-by-step breakdown.
Hexadecimal Arithmetic, Explained
Addition
1A3 + 2F = 1D2
1 A 3
+ 0 2 F
-------
1 D 2| Step | Description | Result |
|---|---|---|
| Convert 1A3 | (1 x 256) + (10 x 16) + 3 | 419 |
| Convert 2F | (2 x 16) + 15 | 47 |
| Add | 419 + 47 | 466 |
| Convert back | decimal 466 to hex | 1D2 |
Subtraction
1A3 - 2F = 174
1 A 3
- 0 2 F
-------
1 7 4Base is 16, so borrowing one from the next place adds 16 to the current place before subtracting.
Multiplication
A x 5 = 32
A hex = 10 decimal 10 x 5 = 50 decimal 50 decimal = 32 hex
Division
1D2 / A = 2E remainder 6
1D2 hex = 466 decimal A hex = 10 decimal 466 / 10 = 46 remainder 6 46 decimal = 2E hex
Practical Uses
Reading Memory Dumps and Log Output
Debuggers, disassemblers, and crash logs print addresses and register values in hex because it maps cleanly onto bytes. A stray 0x7F or 0xFFFFFFFF in a log is easier to trace back to its source once you can convert it on the spot.
0x7F = 127
Picking and Checking Colors
Every CSS color is a hex triplet under the hood. Designers hand off swatches as hex, developers wire them into RGB or HSL for animations — converting between the two happens constantly.
#2563EB = rgb(37, 99, 235)
Networking and Firmware Bytes
IP addresses, MAC addresses, CRC checksums, and firmware images are stored and transmitted as raw bytes, which tools display in hex because it's four times shorter than binary and lines up one digit per nibble.
192.168.1.1 = 0xC0A80101
Common Hex Values at a Glance
These bit-width boundaries come up so often in programming that it's worth recognizing them on sight instead of converting each time.
| Hex | Decimal | Why it matters |
|---|---|---|
| 0x00 | 0 | All bits clear |
| 0x0F | 15 | Low nibble fully set — a common bitmask |
| 0x7F | 127 | Largest positive signed 8-bit value |
| 0x80 | 128 (unsigned) / -128 (signed) | Smallest signed 8-bit value in two's complement |
| 0xFF | 255 | All 8 bits set — largest unsigned byte |
| 0xFFFF | 65535 | All 16 bits set — max unsigned short |
Why Use This Hex Calculator
- Runs entirely in your browser — no sign-up, no upload, nothing sent to a server
- Catches arithmetic mistakes in manual hex math before they reach code or hardware
- Shows hex, decimal, binary, and octal for every result at once, so you don't reach for a second tool
- Arbitrary-precision engine handles values well past 64-bit without overflowing
- Every step of the calculation is shown, not just the final answer
Frequently Asked Questions
Why does hexadecimal use the letters A through F?
Base 16 needs sixteen distinct symbols per digit. Digits 0-9 only cover ten of them, so hex borrows A-F for the values 10-15. C, for instance, is a single digit standing in for decimal 12.
How do I convert hex to decimal by hand?
Multiply each digit by 16 raised to its position (counting from 0 on the right) and add the results. 9B = (9 x 16^1) + (11 x 16^0) = 144 + 11 = 155.
How do I convert hex to decimal in JavaScript or Python?
JavaScript: parseInt("9B", 16). Python: int("9B", 16). Both read a hex string and return its decimal value — useful when you want to check a manual conversion or parse hex from user input.
What does the 0x prefix mean, and are there other hex notations?
0x marks a literal as hexadecimal in most languages (C, JavaScript, Python). Assembly and some hardware docs instead use an "h" suffix, like 9Bh — same value, different convention.
Can hex values be negative?
Hex digits themselves don't carry a sign — negative values only exist once you interpret the bits with a signed encoding like two's complement at a fixed bit width. Switch to Convert / Inspect above to see a value's signed and unsigned reading side by side.
Why does hex subtraction borrow 16 instead of 10?
Borrowing pulls one unit from the next column, and in base 16 that unit is worth 16 in the current column — not 10 like in decimal. F - A still works the same way, it just adds 16 before subtracting when a digit runs short.
Does this calculator handle numbers bigger than 64-bit?
Yes. The engine uses arbitrary-precision arithmetic rather than fixed-width integers, so values well beyond a standard 64-bit range still add, subtract, multiply, and divide correctly.
Where does hex show up outside of programming?
CSS and design tools use it for color codes (#2563EB), networking tools use it for MAC addresses and packet dumps, and file formats use it in hex editors to show raw bytes that would be unreadable as plain decimal.