MOSFET: how it works, with live circuits
A MOSFET is a transistor that a voltage turns on and off. Learn its symbol, its pins and N vs P channel, then flip two live MOSFET switch circuits in the DCACLab simulator.
The two circuits below work without an account. On a computer or tablet the full lab is limited without an account; a free account lets you try it in full first. NGSpice charts need an account; saving needs a plan. Create a free account
What is a MOSFET?
MOSFET stands for metal-oxide-semiconductor field-effect transistor. Its pins are the gate (G), the drain (D) and the source (S). Current flows between drain and source through a channel, and the gate-source voltage decides whether the channel is open. An oxide layer insulates the gate, so it draws no steady current. The lab's MOSFETs are enhancement mode: off with the gate at the source voltage, on once the gate passes a threshold.
The MOSFET symbol and its three pins
These are the symbols the lab draws in its Symbols view. The gate is the plate above the channel, wired to the G pin on the left; the channel is the broken line, broken because the part is off until the gate turns it on. The arrow points in on the N-channel symbol and out on the P-channel one. On the lab's part the pins sit in a row, G, D, S from left to right; its Swap D/S setting shows them as G, S, D, as on the N-channel switch below.
N-channel vs P-channel MOSFET
Both are switches, but they turn on in opposite ways:
- N-channel: on when the gate is above the source by more than the threshold, 2.1 V by default in the lab.
- P-channel: on when the gate is below the source by more than the threshold, so its gate-source voltage must fall below −2.1 V.
- N-channel parts usually switch the low side: the load sits between the supply and the drain, the source goes to ground.
- P-channel parts usually switch the high side: the source goes to the supply, the load sits between the drain and ground.
The MOSFET as a switch
Both circuits run on a 9 V battery and light a red LED through 470 Ω. A toggle switch drives the gate through 220 Ω, a 10 kΩ resistor holds it off while the switch is open, and the meter shows the LED current.
N-channel low-side switch
The LED sits between the battery's + and the drain; the source goes to ground. A 10 kΩ pull-down holds the gate at 0 V, so the MOSFET starts off.
- Click the switch. The gate rises to about 8.8 V, far above the 2.1 V threshold: the LED lights and the meter reads about 15.7 mA.
- Click it again. The pull-down brings the gate back to 0 V and the meter reads 0.
- The 0.9 mA in the gate resistor goes into the pull-down, not into the gate.
P-channel high-side switch
The source goes to the battery's +, and the LED sits between the drain and ground. A 10 kΩ pull-up holds the gate at the source voltage, so the MOSFET starts off; the switch pulls the gate to ground.
- Click the switch. The gate drops to about 0.2 V, a gate-source voltage of about −8.8 V: the LED lights and the meter reads about 15.7 mA.
- Click it again. The pull-up brings the gate back to 9 V and the LED goes out.
- Same load, same current, but the gate is pulled up for the N-channel part and down for the P-channel part.
With NGSpice turned on in the full lab, which uses another LED model, both circuits read about 14.0 mA.
How a MOSFET works
The lab uses the simple square-law (Level-1) equations. With Vgs the gate-source voltage, Vds the drain-source voltage, Vth the threshold and β the part's strength:
- Off (cut-off): Vgs below Vth, no channel, almost no current.
- Fully on (linear region): Vgs above Vth and Vds below Vgs − Vth, the channel acts as a small resistor: Id = β × ((Vgs − Vth) × Vds − Vds² / 2).
- Saturation: Vgs above Vth and Vds above Vgs − Vth, the current depends on the gate alone: Id = β / 2 × (Vgs − Vth)².
In the N-channel circuit Vgs − Vth is about 6.7 V but the LED allows only 15.7 mA, so the MOSFET sits deep in the linear region with about 0.02 V across it: almost all of the voltage reaches the load.
A Level-1 model is for learning, not for picking a real part: it has no part numbers, gate charge or heating. Circuits made in the current lab also have a MOSFET's body diode, which conducts only when drain and source are wired the wrong way round.
MOSFET vs BJT
- Control: a MOSFET by the voltage on its gate, a BJT (bipolar junction transistor) by the current into its base.
- Drive: a MOSFET's gate draws no steady current; a BJT needs base current all the time it is on.
- Turn-on: a MOSFET needs its gate a few volts past the threshold, a silicon BJT about 0.7 V from base to emitter.
- Use: MOSFETs switch LEDs, motors and power supplies; BJTs are common in small amplifiers.
More MOSFET circuits
Each runs on its own page without an account.
- N-channel motor switch with a flyback diode – A 12 V DC motor with a diode across it. The MOSFET is set five times stronger than the default, so it drops only about 1.5 V at 5.8 A.
- P-channel high-side switch driven by an NPN transistor – An NPN transistor pulls the MOSFET's gate down: a small signal switching the high side.
- P-channel reverse-polarity protection – A P-channel MOSFET in the + line feeds a 1 kΩ load 9.00 mA. Flip the battery and the current stays at 0.
Try more MOSFET circuits from the community
Built and shared by DCACLab users, checked in the current lab:
- MOSFET with a potentiometer on the gate – Its middle setting puts 4.5 V on the gate and 15.6 mA through the LED.
- N-channel MOSFET low-side switch – A 12 V switch: turn it on and 17.8 mA flows.
- P-channel MOSFET with a buzzer – With 3 V on the gate, the buzzer draws 76.4 mA from 6 V.
Keep going
Frequently asked questions
What does a MOSFET do?
It controls a current with a voltage: a voltage from gate to source opens a channel from drain to source. Most often it switches LEDs, motors and other loads.
Which is better for switching, N-channel or P-channel?
N-channel on the low side, between the load and ground. P-channel on the high side, between the supply and the load, turned on by pulling its gate below the source.
Why does the gate need a pull-down resistor?
The gate draws no current, so when nothing drives it, it keeps its charge and the MOSFET can stay on. A pull-down (a pull-up on a P-channel part) holds the gate off whenever the switch lets go.
Is the MOSFET simulator free online?
Yes. The circuits on this page run free in your browser with no account. With a free account the full lab is free to try, then switches to a limited mode; without an account it opens limited on a computer or tablet. On a phone there is no limit.
Does the MOSFET simulator work on a Chromebook?
Yes. DCACLab runs in the web browser, with nothing to install.
Build your own MOSFET circuit
Open the lab and wire the N-channel low-side switch yourself.