The 2N3904 is the most common NPN bipolar junction transistor in through-hole electronics. TO-92 package, three pins, about three cents. It's in every Arduino starter kit, every breadboard, every "my first transistor circuit." But the pinout isn't what most beginners expect - and that single mistake accounts for probably half the "my circuit doesn't work" posts on electronics forums.
This page gives you the pinout you can reference without scrolling through a datasheet, plus the real mistakes gathered from StackExchange, AllAboutCircuits, and EEVblog discussions. If your 2N3904 circuit isn't working, the answer is probably here.
Facing the flat side with the part number printed on it, pins pointing down. Left to right:
| Pin | Name | Function | Typical Connection |
|---|---|---|---|
| 1 | Emitter (E) | Current sink - electrons flow out of the emitter | Ground (for NPN switch); through emitter resistor (for amplifier) |
| 2 | Base (B) | Control input - small current controls large C-E current | Through a base resistor to control signal (GPIO, sensor, etc.) |
| 3 | Collector (C) | Current entry - load current flows in through the collector | Load (LED, relay, resistor) to positive supply VCC |
This is the single most common 2N3904 problem on every electronics forum. Not all TO-92 transistors use the same pinout.
The 2N3904 uses E-B-C (Emitter, Base, Collector left to right, flat side facing you). European parts like the BC547 use C-B-E - the collector and emitter are swapped. Japanese 2SC-series transistors often have the collector in the middle. Put a BC547 in a board laid out for a 2N3904 without checking the pinout, and your circuit won't work - or worse, you'll exceed the 6V maximum reverse base-emitter voltage and destroy the junction.
Quick fix when you're unsure: use a multimeter in diode mode. Probe pairs of pins. The one that shows ~0.6–0.7V drop to both other pins is the base. Between the remaining two, the one with the slightly larger voltage drop to the base is the emitter. The remaining pin is the collector.
The 2N3904 as a switch is the most common application. Rule of thumb: IB = IC / 20. If your load draws 100 mA, feed the base 5 mA. This guarantees saturation - VCE(sat) drops to ~0.2V, the transistor acts like a closed switch, and power dissipation in the transistor is minimal.
The most frequent switching mistake: not enough base current. A 10 kΩ base resistor from a 3.3V GPIO gives IB ≈ (3.3 − 0.7)/10k = 0.26 mA. With β ≈ 100, that can only switch ~26 mA - fine for an LED, not enough for a relay or motor. The transistor sits in the linear region, VCE stays high, and the part gets hot. Fix: calculate your base resistor for the actual load current.
For analog amplification, the 2N3904 needs to sit in its linear region - not fully off, not fully on. The standard approach is a voltage divider bias (R1, R2 above). The key design rule: the current through the bias divider should be ~10× the expected base current.
Why? Because β varies wildly - 100 to 300 even within the same 2N3904 batch. A "stiff" divider swamps this variation. Weak biasing (like a single 220 kΩ resistor from VCC to base) makes the circuit β-dependent: it works with one 2N3904, fails with another from a different batch. This is the second most common forum complaint after pinout mistakes. Per the onsemi 2N3904 datasheet (Rev 11, 2N3904/D), β at IC = 10 mA ranges from 100 to 300 - a 3:1 spread. The fix: stiffen the divider.
| Parameter | Value | Notes |
|---|---|---|
| Type | NPN Bipolar Junction Transistor | — |
| Package | TO-92 (through-hole); SOT-23 as MMBT3904 (SMD) | Pinout differs between packages |
| VCEO (max) | 40V | Collector-emitter voltage, base open |
| VCBO (max) | 60V | Collector-base voltage, emitter open |
| VEBO (max) | 6V | ⚠️ Reverse base-emitter voltage - exceed this and destroy the junction |
| IC (max continuous) | 200 mA | Absolute maximum. Stay under 100 mA for reliability. |
| IC (peak) | 400 mA | Pulsed only, <1 ms |
| hFE (DC current gain) | 100–300 (at IC = 10 mA) | Per onsemi datasheet Rev 11. Varies 3:1 across production. |
| VCE(sat) | 0.2V typ (at IC = 10 mA, IB = 1 mA) | Saturation voltage when fully on |
| fT (transition frequency) | 300 MHz typ | Gain-bandwidth for RF. Practical switching: keep under 50 MHz. |
| PD (max) | 625 mW (TO-92, TA = 25°C) | Derate above 25°C. SOT-23 version: ~350 mW. |
| Turn-on / Turn-off Time | ~35 ns / ~175 ns | Fast enough for most switching applications |
| Price Reference | $0.02–0.08/unit | One of the cheapest transistors in production |
A reversed 2N3904 works - badly. Gain drops from ~150 to ~3–5. One AllAboutCircuits user measured an apparent gain of 3.6, rebuilt the circuit three times, then checked the pinout and measured 107 after correcting it. If your common-emitter amplifier has "almost no gain," swap C and E.
BC547 = C-B-E. 2N3904 = E-B-C. Drop a BC547 into a 2N3904 footprint without checking, and you've swapped collector and emitter. See Mistake 1 for the result. Worse: if the PCB connects the 2N3904's emitter pad (which becomes the BC547's collector) to ground, you've shorted the load through the wrong pin.
If a negative voltage spike hits the base (inductive kickback from a relay, ringing on a long trace), and it exceeds −6V relative to the emitter, the base-emitter junction avalanches and is permanently damaged. In switching circuits with inductive loads, always put a flyback diode across the load - this protects both the transistor and the rest of the circuit.
When switching from through-hole 2N3904 to SMD MMBT3904, one StackExchange user found the SMD part partially conducting even with the base "open." The TO-92 package's larger leads and body capacitance suppress noise pickup; the tiny SOT-23 package doesn't. Solution: add a 10–100 kΩ pull-down resistor from base to ground in all switching circuits. This also speeds up turn-off by providing a discharge path for stored base charge.
Connecting a GPIO directly to the base without a resistor = shorting the GPIO through a forward-biased diode to ground. The base-emitter junction is a diode - it clamps at ~0.7V and will draw as much current as the GPIO can supply until one of them fails. Always use a base resistor. Minimum value: RB = (VGPIO − 0.7V) / IB_required.
The classic rookie amplifier: a single 220 kΩ resistor from VCC to base. This circuit's operating point depends entirely on β - swap the transistor and the bias point shifts. Fix: use a voltage divider (R1 from VCC to base, R2 from base to ground) with divider current ≥ 10× IB. Typical values: R1 = 47 kΩ, R2 = 3.9 kΩ for a 12V supply. This is the "stiff divider" rule and it's the difference between a circuit that works with one transistor and a circuit that works with any 2N3904 you grab from the bin.
| Parameter | Details |
|---|---|
| Part Number | 2N3904 (TO-92) / MMBT3904 (SOT-23) / PZT3904 (SOT-223) |
| Manufacturers | onsemi, Fairchild, STMicroelectronics, multi-source |
| Condition | New, original manufacturer packaging |
| Lead Time | In stock, ship from Shenzhen |
Contact ICMASS for current pricing on your specific quantity. Volume pricing typically ranges from $0.02–$0.08/unit depending on manufacturer and quantity. We stock 2N3904 (TO-92) and MMBT3904 (SOT-23) with full manufacturer traceability.
A: Flat side facing you, pins down: Pin 1 = Emitter (left), Pin 2 = Base (center), Pin 3 = Collector (right). E-B-C. Not the same as BC547 (C-B-E). Always verify with a multimeter in diode mode if unsure - the pin that conducts to both others is the base.
A: Yes, in most circuits. Both are NPN, similar gain, similar voltage/current ratings. The 2N2222 handles slightly more current (600 mA vs 400 mA peak). But check the pinout: the 2N2222 in TO-92 also uses E-B-C - same as the 2N3904. The metal-can 2N2222A has a completely different pinout. Always verify.
A: It's not fully saturated. In switch mode, if VCE > 0.3V when "on," the transistor is operating in its linear region - dissipating power as heat. P = VCE × IC. Fix: increase base current (reduce RB) until VCE drops below 0.3V. Rule of thumb: IB = IC/20 for guaranteed saturation.
A: Use a stiff voltage divider on the base - not a single resistor. R1 (VCC to base) and R2 (base to ground). Divider current should be ≥ 10× expected base current. For a 12V supply: R1 = 47 kΩ, R2 = 3.9 kΩ gives VB ≈ 0.92V. Add an emitter resistor RE for DC stability. Gain ≈ −RC/RE.
A: Yes, with two precautions. (1) Size the base resistor for IC/20 - a 75 mA relay coil needs ~3.8 mA base current: RB = (3.3 − 0.7)/0.0038 ≈ 680Ω. (2) Always add a flyback diode (1N4148 or 1N4001) across the relay coil, cathode to VCC. Without it, the inductive kick when the transistor turns off can exceed the 40V VCEO rating and destroy the 2N3904.
A: Same silicon, different package. 2N3904 = TO-92 through-hole. MMBT3904 = SOT-23 surface-mount. The pinout is different. MMBT3904 SOT-23: Pin 1 = Base, Pin 2 = Emitter, Pin 3 = Collector. Do not assume the same pin mapping. MMBT3904 also has lower power dissipation (350 mW vs 625 mW) due to the smaller package.
A: The base-emitter junction is a diode - it clamps at ~0.7V. Without a resistor, the GPIO pin sees a near-short to ground through that diode. The GPIO will try to supply as much current as it can until either the GPIO driver burns out or the base-emitter junction fuses. Never omit the base resistor. Even for a simple test, 1 kΩ minimum.
A: β varies 3:1 (100–300) within the same part number. If your bias network is weak (single high-value resistor from VCC to base), the operating point shifts with β. Two transistors from different batches land at completely different bias points. Fix: stiffen the bias divider so divider current >> IB. The circuit should work identically with any 2N3904 you plug in.





