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.