HEX Bitwise Utility

Hex Bitwise Calculator

Perform hexadecimal bitwise AND, OR, XOR, NOT, NAND, NOR and XNOR operations with exact 8, 16, 32 or 64-bit arithmetic. Enter hex values, inspect their binary representations and view the resulting hexadecimal, binary and unsigned decimal values.

✓ Hex AND ✓ Hex OR ✓ Hex XOR ✓ Hex NOT ✓ NAND / NOR / XNOR ✓ 64-bit Exact Math
0x
Hex Bitwise Operations
● Ready
Enter a hexadecimal integer such as CC, 0xCC, FFFF or DEADBEEF.
Enter the second hexadecimal operand.
Calculation Options
Fixed-width logic: NOT, NAND, NOR and XNOR require a defined width because their inversion step changes every bit inside the selected 8, 16, 32 or 64-bit mask.
Hex Bitwise Result Calculated
Hexadecimal Result
Operation
Bit Width
Result Hex
Result Decimal
A Hex
B Hex
1 Bits
0 Bits
Binary Calculation
Hexadecimal Calculation
Calculation Details

Hex Bitwise Calculator

The Hex Bitwise Calculator performs common bitwise operations directly on hexadecimal integers. It supports AND, OR, XOR, NOT, NAND, NOR and XNOR and displays the exact binary, hexadecimal and unsigned decimal result.

Hexadecimal is especially convenient for bitwise work because every hexadecimal digit corresponds to four binary bits. For example, hexadecimal A is binary 1010 and hexadecimal F is binary 1111.

The calculator supports 8-bit, 16-bit, 32-bit and 64-bit widths using exact integer arithmetic, making it suitable for masks, registers, protocol values, firmware constants and larger unsigned values.

How to Use the Hex Bitwise Calculator

Enter hexadecimal Value A and Value B, choose a bitwise operation and select the required bit width. For the unary NOT operation, only Value A is required.

Press Calculate Hex Bitwise Result. The calculator converts both operands to fixed-width binary, applies the selected operation and converts the result back to hexadecimal and decimal.

A: CC B: AA Operation: AND Binary: 11001100 10101010 Result: 10001000 Hex: 88

Hexadecimal AND Calculator

Bitwise AND produces a 1 only when both corresponding input bits are 1. It is commonly used to clear bits or extract selected fields with masks.

A: CC = 11001100 B: AA = 10101010 AND: 88 = 10001000

Hexadecimal OR Calculator

Bitwise OR produces a 1 whenever either corresponding input bit is 1. It is often used to set selected bits.

A: CC = 11001100 B: AA = 10101010 OR: EE = 11101110

Hexadecimal XOR Calculator

XOR produces a 1 when corresponding bits differ and 0 when they are equal.

A: CC = 11001100 B: AA = 10101010 XOR: 66 = 01100110

XOR is commonly used for toggling bits, comparing bit patterns and various low-level algorithms.

Hexadecimal NOT Calculator

Bitwise NOT inverts every bit in the selected width. Because NOT depends on width, hexadecimal CC has different NOT results at 8 and 16 bits.

8-bit: A: CC = 11001100 NOT: 33 = 00110011 16-bit: A: 00CC NOT: FF33

Hexadecimal NAND Calculator

NAND means NOT AND. The calculator first performs AND and then inverts the result inside the selected fixed-width mask.

A: CC B: AA AND: 88 NAND: 77

Hexadecimal NOR Calculator

NOR is the inverse of OR. Every bit in the OR result is complemented within the chosen width.

A: CC B: AA OR: EE 8-bit NOR: 11

Hexadecimal XNOR Calculator

XNOR is the inverse of XOR and returns 1 where corresponding bits are equal.

A: CC B: AA XOR: 66 XNOR: 99

Hex Bitwise Operation Comparison

Operation A = CC B = AA 8-Bit Result
ANDCCAA88
ORCCAAEE
XORCCAA66
NANDCCAA77
NORCCAA11
XNORCCAA99

Why Hexadecimal Works Well for Bitwise Operations

Every hexadecimal digit represents exactly four binary bits, called a nibble. This makes conversions between hex and binary direct and predictable.

Hex: D6 D: 1101 6: 0110 D6: 11010110

This compact representation is why addresses, memory values, registers, masks and binary file data are frequently written in hexadecimal.

8-Bit Hex Bitwise Operations

An 8-bit hexadecimal value contains two hex digits and ranges from 00 through FF.

Maximum 8-bit value: FF Binary: 11111111 Decimal: 255

All calculations in 8-bit mode are restricted to those eight binary positions.

16-Bit Hex Bitwise Operations

A 16-bit value contains four hexadecimal digits and ranges from 0000 to FFFF.

A: 1234 B: 00FF AND: 0034 OR: 12FF XOR: 12CB NOT A: EDCB

32-Bit Hex Bitwise Operations

32-bit mode supports eight hexadecimal digits and the complete unsigned range from 00000000 through FFFFFFFF.

A: FFFFFFFF B: 0F0F0F0F AND: 0F0F0F0F XOR: F0F0F0F0 XNOR: 0F0F0F0F

The tool does not rely on ordinary JavaScript signed 32-bit bitwise results, so values with the highest bit set remain unsigned.

64-Bit Hex Bitwise Operations

64-bit mode accepts up to sixteen hexadecimal digits and uses exact BigInt arithmetic.

A: FFFFFFFFFFFFFFFF B: 0000000000000001 AND: 0000000000000001 XOR: FFFFFFFFFFFFFFFE XNOR: 0000000000000001

This avoids precision loss that can occur when 64-bit values are stored in ordinary floating-point numbers.

Why Bit Width Matters

AND, OR and XOR produce the same lower-bit relationships regardless of additional leading zero positions, but operations containing NOT depend directly on width.

A: 01 8-bit NOT: FE 16-bit NOT: FFFE 32-bit NOT: FFFFFFFE

The width defines which bits are considered part of the integer and therefore which bits the NOT operation should invert.

Hex Masks and Bitwise AND

AND is frequently used with hexadecimal masks to isolate selected bits or fields.

Value: D7 Mask: 0F AND: 07 Binary: 11010111 00001111 -------- 00000111

The mask clears the upper four bits while preserving the lower four.

Set Bits with Hex OR

OR can force particular bits to one while leaving other positions unchanged.

Value: 80 Mask: 0F OR: 8F

The lower nibble becomes all ones while the existing high bit remains set.

Toggle Bits with Hex XOR

XOR is useful for toggling selected bits. A mask bit of 1 flips the corresponding value bit, while a mask bit of 0 leaves it unchanged.

Value: AA Mask: 0F XOR: A5

Hex Bitwise Calculator for Registers

Hardware registers are frequently documented using hexadecimal values because individual bit fields can be seen more compactly than in long binary strings.

A developer may AND a register with a mask to extract flags, OR it with a mask to set control bits, XOR selected positions to toggle them or use NOT-based operations while testing logic expressions.

Register: B6 Mask: 0F B6 AND 0F: 06 B6 OR 0F: BF B6 XOR 0F: B9

Hex Bitwise Calculator for Programming

Bitwise operations appear throughout low-level software, operating systems, graphics, embedded programming, networking, cryptography, compression and binary file formats.

Hexadecimal is often preferred when code contains constants such as 0xFF, 0x8000 or 0xFFFFFFFF because these values correspond neatly to groups of binary bits.

Typical use cases

Common uses include permission masks, status flags, device registers, protocol fields, color channels, packet parsing, feature flags, instruction encoding and binary data inspection.

Hex Bitwise vs Decimal Bitwise Calculation

The underlying operation is identical regardless of whether a number is written in hexadecimal, decimal or binary. Only the textual representation differs.

Hex: CC AND AA = 88 Decimal: 204 AND 170 = 136 Binary: 11001100 AND 10101010 = 10001000 All three represent the same calculation.

Common Hex Bitwise Calculation Mistakes

One common mistake is forgetting that hexadecimal digits represent groups of four bits rather than decimal digits. Hexadecimal 10 equals decimal 16, not decimal 10.

Another mistake is applying unrestricted NOT without choosing a width. A fixed-width mask must be used to obtain a useful unsigned NOT, NAND, NOR or XNOR result.

It is also important to avoid confusing bitwise operators with logical operators. A bitwise operation produces a result for every binary position rather than reducing the entire value to true or false.

Hex Bitwise Calculator Limitations and Notes

This calculator handles unsigned 8, 16, 32 and 64-bit hexadecimal integers. Negative signed values are intentionally excluded because their hex representation depends on a signed encoding and fixed width.

Values shorter than the selected width are treated as having leading zeros. For example, CC in 16-bit mode is treated as 00CC.

NOT-based operations are explicitly masked to the selected width, ensuring predictable unsigned results instead of sign-extended values.

Hex Bitwise Calculator FAQs

What is a hex bitwise calculator?
It performs binary logic operations on integers entered in hexadecimal form and returns the resulting hexadecimal, binary and decimal values.
What is CC AND AA?
In 8 bits, CC AND AA equals 88.
What is CC OR AA?
CC OR AA equals EE.
What is CC XOR AA?
CC XOR AA equals 66.
What is NOT CC in 8 bits?
CC is binary 11001100. Inverting all eight bits gives 00110011, or hexadecimal 33.
What is CC NAND AA?
CC AND AA equals 88. Inverting 88 inside eight bits produces 77.
What is CC NOR AA?
CC OR AA equals EE. Inverting EE inside eight bits gives 11.
What is CC XNOR AA?
CC XOR AA equals 66. Inverting 66 inside eight bits gives 99.
Can I enter 0x-prefixed values?
Yes. Both CC and 0xCC are accepted.
Does the calculator support 16-bit hex values?
Yes. Select 16-bit for values up to FFFF.
Does it support 32-bit hexadecimal?
Yes. The complete unsigned 32-bit range through FFFFFFFF is supported.
Does it support 64-bit hexadecimal?
Yes. Exact BigInt arithmetic is used for values through FFFFFFFFFFFFFFFF.
Why does NOT require a bit width?
NOT inverts every position, so the calculator needs to know whether to invert 8, 16, 32 or 64 bits.
Can I convert the result to decimal?
Yes. Select Unsigned Decimal as the primary output or view the decimal result in the result summary.
Can I see the binary operation?
Yes. The result section shows the fixed-width binary operands and the result so every bit position can be inspected.
Scroll to Top