NOR Calculator

Compute the bitwise NOR of two whole numbers, bit by bit: see NOT(A OR B) in decimal, binary, and hexadecimal, plus how many result bits are set to 1.

Quick Facts

Rule
Each result bit is 1 only when both input bits are 0
NOR is the inverse of OR: A NOR B = NOT (A OR B).
Identity
A NOR 0 = NOT A; A NOR (all 1s) = 0
NORing with an all-zero value gives the bitwise complement of A within the chosen bit width.
Universal gate
NOR alone can build any logic circuit
NOT, AND, OR, and XOR can all be constructed from NOR gates only.

Your Results

Calculated
A NOR B
-
Decimal result
Binary result
-
Zero-padded to bit width
Hexadecimal result
-
Base-16 representation
Result bits set to 1
-
Bit positions where both A and B are 0

Ready

Enter two whole numbers and a bit width, then press Calculate.

How the NOR Calculator works

This tool computes the bitwise NOR of two whole numbers. Bitwise NOR compares two numbers one binary digit (bit) at a time and inverts the OR: the result has a 1 in a given position only if neither number has a 1 in that position, and a 0 everywhere either number has a 1. It is the logical negation of OR, and — along with NAND — one of the two "universal" logic gates from which every other logic function can be built.

Formula and method

For each bit position, the result bit follows a simple rule: result = 1 only when both A and B have a 0 in that position; if either bit is 1, the result bit is 0. That gives the single-bit truth table 0 NOR 0 = 1, 0 NOR 1 = 0, 1 NOR 0 = 0, 1 NOR 1 = 0 — the exact opposite of OR's truth table. To compute A NOR B for whole numbers, write both numbers in binary padded to the selected bit width, OR them together column by column, then flip every bit of that OR result. For example, 12 (1100 in binary, 8-bit padded to 00001100) NOR 10 (00001010) gives OR = 00001110, then NOT that = 11110001, which is 241 in decimal.

Common sources of error

  • Bit width too small: a number that does not fit the selected bit width is rejected rather than silently truncated — choose 16-bit or 32-bit for larger values.
  • Forgetting the bit width matters for NOT: unlike AND or OR, NOR's result depends entirely on the bit width chosen, because the NOT step flips every bit up to that width — the same A and B give a different decimal result at 8-bit versus 32-bit.
  • Confusing NOR with NAND: NOR requires both bits to be 0 to output 1; NAND requires at least one bit to be 0. They are different operations with different truth tables.

Checking your result

A quick sanity check: A NOR B is the bitwise complement of (A OR B) within the chosen bit width, so its result bits and the OR result's bits are always exact opposites at every position — if you XOR the NOR result with the OR result, you should get all 1s (the maximum value for that bit width). You can also verify small examples by hand: OR the two binary numbers together first, then flip every bit of that outcome.

Applications

Bitwise NOR appears throughout digital logic design: as a universal gate, entire circuits (including AND, OR, NOT, and XOR gates) can be built using only NOR gates, which made it a historically important building block in early integrated circuits. In software, NOR-style masking is used to test whether none of a set of flag bits are set, and to invert-and-combine two bitmasks in a single step.

Frequently Asked Questions

What does bitwise NOR do?
Bitwise NOR compares two numbers bit by bit and inverts the result of OR. Each bit in the result is 1 only when the matching bit in both numbers is 0; if either bit is 1, the result bit is 0.
How is NOR related to OR and NOT?
NOR is literally NOT OR: first compute A OR B for each bit, then flip every bit of that result. A NOR B = NOT (A OR B).
Why is NOR called a universal logic gate?
Every other basic logic function — NOT, AND, OR, NAND, XOR, XNOR — can be built using only NOR gates wired together. That makes NOR (along with NAND) a functionally complete building block for digital circuits.
Can this calculator handle negative numbers?
This tool treats both inputs as non-negative integers represented in plain binary up to the selected bit width (8, 16, or 32 bits). The NOT part of NOR is only well-defined once a fixed bit width is chosen, since flipping bits above an unbounded number would give an infinite string of 1s.