A NOT gate is the simplest logic gate you can build. It has one input and one output, and it flips the signal: feed in a 1 (high voltage), and you get a 0 (low voltage) out. Feed in a 0, and you get a 1. That’s it. The truth table has just two rows: input high gives output low, input low gives output high. There are several practical ways to build one, depending on the components you have available.
How a NOT Gate Works
In digital logic, signals are represented as voltage levels. A “high” signal (logic 1) is a voltage near the power supply level, and a “low” signal (logic 0) is a voltage near ground. A NOT gate, also called an inverter, takes whatever signal arrives at its input and produces the opposite at its output.
The exact voltages that count as “high” or “low” depend on the technology. In TTL circuits running at 5 volts, anything from 2V to 5V counts as high input, and 0V to 0.8V counts as low. In CMOS circuits at the same voltage, the thresholds are cleaner: 3.5V to 5V for high, and 0V to 1.5V for low. CMOS outputs are also much sharper, swinging to within 0.05V of the supply rails.
Building One With Transistors
The most common way to make a NOT gate from scratch is with a single transistor and a resistor. If you have an NPN bipolar transistor (like a 2N2222 or 2N3904), wire it in what’s called a common-emitter configuration:
- Emitter connects to ground.
- Collector connects to your positive supply voltage (typically 5V) through a resistor (around 1kΩ to 10kΩ).
- Base receives the input signal through a resistor (around 10kΩ to 47kΩ).
- Output is taken from the collector.
When the input is high, current flows into the base, turning the transistor on. The collector gets pulled down to nearly 0V, giving you a low output. When the input is low, no base current flows, the transistor stays off, and the resistor pulls the collector up to the supply voltage, giving you a high output. Input high, output low. Input low, output high. That’s your NOT gate.
The CMOS Approach
Professional digital circuits use a pair of complementary transistors instead of a transistor and resistor. A CMOS inverter uses one PMOS transistor and one NMOS transistor stacked between the power supply and ground. The PMOS transistor turns on when the input is low, pushing the output high. The NMOS transistor turns on when the input is high, pulling the output low. At any given moment, only one transistor is conducting, which is why CMOS circuits use almost no power when they’re sitting in a steady state.
You can build this yourself using a CD4007 chip, which contains complementary MOSFET pairs meant for experimenting. Connect the PMOS source to your supply voltage, the NMOS source to ground, tie both gates together as your input, and take the output from where the two drains meet.
Using a NAND Gate as an Inverter
If you already have a NAND gate chip (like the 74HC00, which contains four two-input NAND gates), you can turn any of those gates into a NOT gate with a single wire. Just connect both inputs of the NAND gate together. Your single signal now feeds both inputs simultaneously.
A NAND gate outputs low only when both inputs are high. When you tie the inputs together, the only possibilities are “both high” or “both low.” Both high gives a low output. Both low gives a high output. That’s inversion. Using Boolean algebra, the output of a NAND gate is (A·B)’. When A and B are the same signal, this simplifies to A’, which is just “NOT A.” This trick is useful because NAND gates are considered universal gates, capable of implementing any logic function.
Building One With a Relay
For a more visual, hands-on approach, you can build a NOT gate using an electromagnetic relay. The key is to use the relay’s normally closed (NC) contact. This is the terminal that stays connected to the common terminal when the relay coil has no power.
Wire the relay so your input signal energizes the coil. Connect your output circuit through the normally closed contact. When the input is off (low), the relay coil is de-energized, the NC contact stays closed, and your output circuit is complete, reading as high. When the input is on (high), the coil energizes, the NC contact opens, and the output drops to low. This is exactly NOT gate behavior, just implemented with a mechanical switch instead of semiconductors. Relay logic is slower and bulkier than transistor circuits, but it makes the inversion concept physically visible and audible (you can hear the relay click).
Using a Dedicated Inverter Chip
The fastest way to get a working NOT gate is to use a chip designed for the job. The 74HC04 is one of the most common: it contains six independent inverters in a single 14-pin package. Connect power and ground to the chip, feed your input signal to one of the input pins, and read the inverted output from the corresponding output pin. No external resistors or wiring tricks needed.
Some inverter chips include Schmitt trigger inputs (like the 74HC14), which add a useful feature: they clean up noisy or slowly changing signals. A standard inverter can behave unpredictably when the input voltage lingers in the undefined zone between high and low. A Schmitt trigger inverter has built-in hysteresis, meaning it snaps cleanly between states even with a sloppy input signal. This makes Schmitt inverters useful for turning analog-ish signals (like the slow voltage ramp from an RC timing circuit) into crisp digital edges.
Schmitt inverters can even be wired as simple oscillators. Feed the output back to the input through a resistor and capacitor, and the gate will toggle itself repeatedly. The RC time constant sets the frequency. This is a common technique for generating clock signals in simple digital circuits without needing a dedicated oscillator component.
Choosing the Right Method
Your best option depends on what you’re trying to accomplish. If you’re learning digital logic fundamentals, build one from a single transistor and resistor so you can see the inversion happen at the component level. If you’re prototyping a digital circuit on a breadboard, grab a 74HC04 or repurpose a spare NAND gate. If you’re building a relay computer or a demonstration board for a class, the relay approach makes the logic tangible.
For any transistor-based approach on a breadboard, keep your wires short and add a small capacitor (0.1µF) between the power supply and ground near the chip. This filters out voltage noise that can cause erratic behavior. And if your input signal comes from a mechanical switch, consider using the Schmitt trigger variant to avoid the output bouncing between states as the switch contact settles.

