Most gates come in versions with more than two inputs. The number of inputs is the gate's fan in. Each type extends its two-input rule in a natural way:
- AND: 1 only when every input is 1, as in .
- OR: 1 when at least one input is 1, as in .
- NAND: 0 only when every input is 1, as in .
- NOR: 1 only when every input is 0, as in .
- XOR: 1 when an odd number of inputs are 1.
- XNOR: a multi-input XOR with an output bubble, so 1 when an even number of inputs are 1.
A gate with n inputs has 2ⁿ truth-table rows. The number of rows that give 1 follows a pattern:
- AND and NOR: exactly 1 row.
- OR and NAND: all but 1 row, so 2ⁿ − 1.
- XOR and XNOR: exactly half, 2ⁿ⁻¹.
You can build a wide AND, OR or XOR by chaining or tree-wiring 2-input gates of the same type, because those operations are associative. That trick fails for NAND, NOR and XNOR. Their built-in inversion acts in the middle of the chain, so build the non-inverting version first and invert once at the end.