NOR Calculator
Calculate the bitwise NOR of two numbers and see the result in binary, hex, octal and decimal.
Updated
NOR Calculator
Our NOR Calculator applies the NOR operation to two numbers
bit by bit, the same as ~(a | b) in code. Type the numbers in decimal, binary,
octal or hex, choose a bit width from 1 to 64, and see the result in every format, with the
OR step and the NOT step lined up so you can follow each bit.
Quick answer
NOR is “NOT OR”: A NOR B = NOT (A OR B), so each result bit is 1 only where both numbers have a 0. For 12 (0000 1100) and 10 (0000 1010) in 8 bits, A OR B = 0000 1110, and flipping it gives 12 NOR 10 = 1111 0001 = 241 (−15 signed). Enter any two numbers above and the calculator shows the result instantly.
- Truth table: only 0 NOR 0 gives 1; every other pair gives 0
- In code: ~(a | b), or ~a & ~b by De Morgan’s law
- Bit width matters: 12 NOR 10 is 241 in 8 bits but 65,521 in 16 bits
- Universal gate: NOT, OR and AND can all be built from NOR alone
What Is NOR?
NOR is a logic operation that combines OR with NOT. OR gives 1 when at least one input is 1; NOR then flips that answer, so it gives 1 only when neither input is 1. A bitwise NOR does this in every bit position of two binary numbers at once, with no carrying between positions.
Because the final NOT flips every bit, including the leading zeros, a NOR result depends on how many bits the numbers have. That is why the calculator asks for a bit width, and why it shows both the unsigned and the signed reading of the result.
NOR Truth Table
| A | B | A OR B | A NOR B |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 |
NOR Formula
= (NOT A) AND (NOT B) (De Morgan’s law)
In code: ~(a | b) or ~a & ~b
In w bits, unsigned: (2^w − 1) − (A OR B)
The last line works because flipping every bit of a w-bit number is the same as subtracting it from 2w − 1, the number with all w bits set. In 8 bits that is 255, so 12 NOR 10 = 255 − 14 = 241. NOR is also written as A ↓ B (the Peirce arrow).
Example Calculations
5 NOR 3 (8-bit): ~(0000 0101 | 0000 0011) = ~0000 0111 = 1111 1000 = 248 (−8)
0 NOR 0 (8-bit): ~0000 0000 = 1111 1111 = 255 (−1)
255 NOR 0 (8-bit): ~1111 1111 = 0000 0000 = 0
12 NOR 10 (16-bit): ~0000 0000 0000 1110 = 65,521 (−15)
The signed value (in brackets) does not change with the bit width: 241 in 8 bits and 65,521 in 16 bits are both −15 in two’s complement.
NOR as a Universal Gate
NOR is “functionally complete”: any logic circuit can be built from NOR gates alone. These three identities show how:
| Operation | Built from NOR |
|---|---|
| NOT A | A NOR A |
| A OR B | (A NOR B) NOR (A NOR B) |
| A AND B | (A NOR A) NOR (B NOR B) |
This made NOR popular in early integrated circuits, since a factory only had to make one kind of gate. The Apollo Guidance Computer was built from NOR gate chips, and the 7402 chip with four 2-input NOR gates is still a staple of electronics courses.
Key Terms
- NOR
- NOT OR: 1 only when both inputs are 0.
- Bit width
- How many bits each number has, such as 8, 16, 32 or 64.
- De Morgan’s law
- NOT (A OR B) = (NOT A) AND (NOT B).
- Universal gate
- A gate that can build every other logic function on its own: NOR and NAND.
- Two’s complement
- The usual way to store negative numbers: −n in w bits is stored as 2w − n.
How to Use the NOR Calculator
- Enter A and B. Type the two numbers in the “Number A” and “Number B” boxes. Pressing Enter in A moves you to B. Decimal numbers can be negative.
- Pick the number format. Choose Dec, Bin, Oct or Hex for both numbers, or type a 0b, 0o or 0x prefix and the format switches by itself. Switching format converts the numbers already typed, so 12 becomes 1100 in binary.
- Set the bit width. Use the 8, 16, 32 or 64 chips, or type any width from 1 to 64. NOR flips the leading zeros too, so the width changes the answer.
- Read the result. The NOR appears as soon as both numbers are filled, in the same format you typed, with the working underneath (for example 12 NOR 10 = 241, ~(1100 | 1010) = ~00001110 = 11110001). Below it, A, B, A OR B and the NOR are lined up bit by bit, and a table gives the result in binary, hexadecimal, octal, unsigned and signed decimal.
- Copy the result. Press Copy to copy the result without the spaces between digit groups. Press Clear or Esc to start again.
Example: enter A = 5 and B = 3 with an 8-bit width, and the result is 248, with A OR B = 0000 0111 flipped to 1111 1000.
Who Can Use This Calculator?
Frequently Asked Questions (FAQs)
What is a NOR operation?
NOR means “NOT OR”. It gives 1 only when both inputs are 0, and 0 in every other case. Applied bitwise, it compares two numbers one bit position at a time: A NOR B = NOT (A OR B).
How do you calculate 12 NOR 10?
Write both numbers in binary at the chosen width: in 8 bits, 12 = 0000 1100 and 10 = 0000 1010. OR them to get 0000 1110 (14), then flip every bit to get 1111 0001. So 12 NOR 10 = 241 unsigned, or −15 when read as a signed 8-bit number.
Why does the bit width change the NOR result?
NOR flips every bit, including the leading zeros. In 8 bits, 12 NOR 10 = 1111 0001 = 241; in 16 bits it is 1111 1111 1111 0001 = 65,521. The signed value stays the same (−15) because two’s complement reads the extra leading ones as part of the same negative number.
What is the NOR truth table?
0 NOR 0 = 1, 0 NOR 1 = 0, 1 NOR 0 = 0 and 1 NOR 1 = 0. The output is 1 only in the first row, when both inputs are 0. It is the exact opposite of OR.
Why is NOR called a universal gate?
Every other logic operation can be built from NOR gates alone. NOT A = A NOR A, A OR B = (A NOR B) NOR (A NOR B), and A AND B = (A NOR A) NOR (B NOR B). The Apollo Guidance Computer was famously built from NOR gate chips. NAND is the other universal gate.
What is the difference between NOR and NAND?
NOR gives 1 only when both inputs are 0; NAND gives 0 only when both inputs are 1. For 12 and 10 in 8 bits, NOR gives 1111 0001 (241) and NAND gives 1111 0111 (247). You can try AND, OR, XOR, NAND, NOR and XNOR side by side in the Bitwise Calculator.
How do you write NOR in code?
Most languages have no NOR operator, so write ~(a | b). In C, Java and JavaScript, ~(12 | 10) gives −15. In Python it also gives −15, because Python integers have no fixed width; mask it to get the unsigned value: ~(12 | 10) & 0xFF = 241. By De Morgan’s law, ~a & ~b gives the same result.
What is A NOR 0 and A NOR A?
Both give NOT A, every bit of A flipped. In 8 bits, 5 NOR 0 = 5 NOR 5 = 1111 1010 = 250. And 0 NOR 0 sets every bit, giving 255 in 8 bits.
Is the NOR Calculator free?
Yes. It is completely free, needs no sign-up, and can be used as many times as you like.
Try our NOR Calculator to find the bitwise NOR of any two numbers instantly.