Parts
BC547 vs 2N2222 vs 2N3904: the same job, mirrored pins
By Bulan Sarkar
All three are small NPN transistors in a TO-92 package, and any of them will usually switch an LED, a buzzer or a small relay from a microcontroller pin. Two things stop a blind swap.
The first is the pins. With the flat printed face toward you and the leads down, a BC547 reads collector, base, emitter from the left. A 2N3904 or a 2N2222A (Diotec TO-92) reads emitter, base, collector. The base is in the middle on all three, so the outer leads are mirrored: drop a 2N3904 into a BC547 footprint the same way round and collector and emitter trade places.
The second is current. The BC547 is rated for 100 mA continuous, the 2N3904 for 200 mA and the 2N2222A for 600 mA (Diotec TO-92) or 800 mA (Central's TO-18 metal can).
- A 2N3904 or 2N2222A in place of a BC547 is fine electrically. Turn it around so the outer leads line up, or bend the leads.
- A BC547 in place of a 2N2222A works only if the load stays well under 100 mA and the supply under 45 V.
- A 2N3904 in place of a 2N2222A is fine to 200 mA on paper, but its saturation limits stop at 50 mA. Above that, keep the 2N2222A.
Datasheet: Diotec Semiconductor BC546 ... BC549 General Purpose NPN Transistors (PDF)
Pinout by package
Flat face toward you, leads pointing down: C, B, E from left to right.
Source: Diotec Semiconductor BC546 ... BC549 General Purpose NPN Transistors, p. 1 (TO-92 drawing with leads 1, 2, 3 and symbol: C (1), B (2), E (3))
Flat face toward you, leads pointing down: E, B, C from left to right.
Source: Diotec Semiconductor 2N3904 General Purpose NPN Transistors, p. 1 (TO-92 drawing with leads 1, 2, 3 and symbol: E (1), B (2), C (3))
Flat face toward you, leads pointing down: E, B, C from left to right.
Central's TO-18 metal can uses the same lead code: 1 emitter, 2 base, 3 collector.
Source: Diotec Semiconductor 2N2222A General Purpose NPN Transistors, p. 1 (TO-92 drawing with leads 1, 2, 3 and symbol: E (1), B (2), C (3))
The pins, and the turn-it-around trick
The Diotec datasheets number the leads 1, 2, 3 from the left with the flat face toward you. The BC547 sheet assigns C (1), B (2), E (3). The 2N3904 and 2N2222A sheets assign E (1), B (2), C (3). The drawings above show each one.
Because the base sits in the middle either way, rotating the transistor 180 degrees (flat face away from you) puts collector and emitter back where the board expects them. That is the quickest way to fit a 2N3904 into holes drawn for a BC547, or the other way round. Check the silkscreen first. If it prints the transistor's flat side, the turned part will face the other way to that outline, which is what you want.
Not every part sold as a 2N2222 follows the Diotec order. onsemi's P2N2222A in TO-92 is collector, base, emitter, the same as a BC547, while Central's 2N2222A in the TO-18 metal can is lead 1 emitter, 2 base, 3 collector. Read the part number printed on the body, then the datasheet for that exact part. Our 2N2222 page draws all the variants.
Side by side
| Parameter | BC547TO-92 | 2N3904TO-92 | 2N2222ATO-92 |
|---|---|---|---|
| Collector-emitter voltage, base open VCEO | 45 V | 40 V | 40 V |
| Collector-base voltage VCBO | 50 V | 60 V | 75 V |
| Emitter-base voltage VEBO | 5 V | 6 V | 6 V |
| Collector current, continuous IC | 100 mA | 200 mA | 600 mA (Central TO-18: 800 mA) |
| Power dissipation at 25 °C Ptot | 500 mW | 625 mW | 625 mW (Central TO-18: 500 mW) |
| Thermal resistance, junction to air RthA | under 200 K/W | 200 K/W typ | 200 K/W typ (Central TO-18: 350 °C/W) |
| Junction temperature, max Tj | 150 °C | 150 °C | 150 °C |
| Parameter | BC547TO-92 | 2N3904TO-92 | 2N2222ATO-92 |
|---|---|---|---|
| DC current gain hFEeach sheet uses its own test point | 110-220 (A), 200-450 (B), 420-800 (C) at 2 mA, 5 V | 100-300 at 10 mA, 1 V | 100-300 at 150 mA, 10 V |
| Saturation voltage, max VCE(sat)IC / IB as listed | 250 mV at 10 / 0.5 mA; 600 mV at 100 / 5 mA | 0.2 V at 10 / 1 mA; 0.3 V at 50 / 5 mA | 0.3 V at 150 / 15 mA; 1 V at 500 / 50 mA |
| Transition frequency fT | 300 MHz typ | 300 MHz min | 250 MHz min (Central: 300 MHz min) |
| Collector-base capacitance, max CCBO | 6 pF | 4 pF | 8 pF |
| PNP partner | BC557 | 2N3906 | 2N2907A |
In the saturation row the base current is a tenth or a twentieth of the collector current, and the gain figures come from different test currents and voltages, so don't compare them directly. The BC547 letter suffix (A, B or C) is its gain group; BC547B is the one most kits carry.
Which one fits your job
BC547 suits low-current work: LED indicators, a buzzer, a small-signal amplifier stage, a sensor buffer. Its gain is high (group B is 200 to 450 at 2 mA), so a small base current switches it, and its saturation voltage at 10 mA is 250 mV at most. It runs out of room at 100 mA.
2N3904 sits in the middle. It takes 200 mA continuous, has the lowest collector-base capacitance of the three (4 pF max), and its sheet gives switching times (35 ns delay and rise, 200 ns storage, 50 ns fall, all maximums). Its saturation figures stop at 50 mA, and that is where we stop counting on it as a hard switch.
2N2222A is the one for relays, small motors and LED strings between 100 and 500 mA. The sheets guarantee 0.3 V at 150 mA, but only with 15 mA into the base, and 1 V at 500 mA with 50 mA into the base. That base current has to come from whatever drives the pin, and Figure 3 shows how much each test point asks for.
Worked examples
All three run from a 5 V microcontroller pin and use the datasheet's own test conditions. Heat is estimated with the 200 K/W junction-to-air figure all three sheets give.
1. An 80 mA load with a BC547
The load is under the 100 mA rating. Use the 100 mA test point: base current 5 mA, VCE(sat) at most 600 mV, VBE(sat) typically 900 mV. The base resistor is (5 − 0.9) V ÷ 5 mA = 820 Ω. The worst-case heat is 0.6 V × 80 mA = 48 mW, a rise of under 9.6 °C. It works, with little margin on current. If the load could ever reach 100 mA, move up to a 2N2222A.
2. A 150 mA load with a 2N2222A
This is past the BC547's rating and past the 2N3904's tested saturation range. The 2N2222A sheets give 0.3 V max at 150 mA with 15 mA into the base, and Central gives VBE(sat) between 0.6 and 1.2 V at that point. For at least 15 mA with the worst VBE: (5 − 1.2) V ÷ 15 mA = 253 Ω, so take the next standard value down, 220 Ω. The pin then supplies 17.3 mA at the high VBE and 20 mA at the low one. Heat is 0.3 V × 150 mA = 45 mW, about 9 °C above the room.
The transistor is comfortable. The 17 to 20 mA from the pin is what to check against your microcontroller's datasheet before you build it.
3. Why not 500 mA from a pin?
The 2N2222A is rated for 600 mA, so 500 mA looks allowed. But the 1 V saturation figure at 500 mA assumes 50 mA into the base, far more than a typical GPIO pin is rated for. With less base current the transistor comes out of saturation and VCE rises. Even at the guaranteed 1 V, the heat is 1 V × 0.5 A = 0.5 W, a rise of 100 °C, which puts the junction at 125 °C in a 25 °C room against a 150 °C limit.
For loads of several hundred milliamps from a 5 V or 3.3 V pin, use a logic-level MOSFET. Our IRFZ44N vs IRLZ44N page works through that case.
Worked example in numbers
- BC547, 80 mA
- 820 Ω
- 2N2222A, 150 mA
- 220 Ω
- Pin current, ex. 2
- 17.3 mA to 20 mA
- Junction at 500 mA
- 125 °C
Swapping one for another
| Part | Pins | Verdict |
|---|---|---|
| 2N3904 or 2N2222A for a BC547 | E-B-C | Fine electrically. Turn the part around (flat face the other way) so collector and emitter land where the board expects them.Diotec Semiconductor 2N3904 General Purpose NPN Transistors, p. 1; Diotec Semiconductor 2N2222A General Purpose NPN Transistors, p. 1 |
| BC547 for a 2N2222A | C-B-E | Only if the load stays well under 100 mA and the supply under 45 V, and turned around.Diotec Semiconductor BC546 ... BC549 General Purpose NPN Transistors, p. 1 |
| 2N3904 for a 2N2222A | E-B-C | Same pins. Fine to 200 mA on paper, but its saturation limits stop at 50 mA, so above that keep the 2N2222A.Diotec Semiconductor 2N3904 General Purpose NPN Transistors, p. 2 |
| P2N2222A (onsemi) for a 2N2222A | C-B-E | Sold under the 2N2222A name but wired C-B-E, the opposite of the Diotec part. Check which one the board was drawn for.onsemi P2N2222A/D, p. 6 |
Tips and checks
- Check the flat face and the silkscreen before soldering. A transistor fitted the wrong way round can still pass some current, so the circuit may half-work and mislead you.
- Read the gain letter on a BC547. A BC547A has about a quarter of the minimum gain of a BC547C (110 against 420).
- Keep the base resistor. A base driven straight from a pin overloads both the pin and the transistor.
- Fit a diode across any relay coil or motor. The inductive kick from a 12 V coil can easily pass the 40 to 45 V VCEO ratings.
- When you need the PNP twin for the high side, use the BC557, 2N3906 or 2N2907A. Each maker lists them as the complementary parts.
Finding which way round it is with a multimeter
- Set the meter to diode test. Put the red probe on each lead in turn until you find the one that conducts to both others, about 0.6 to 0.7 V each. That is the base, and on all three of these parts it is the middle lead.
- Reverse the probes: both junctions should read open, and the two outer leads should read open both ways.
- With an hFE socket, try both orientations. The right one reads in the hundreds; the wrong one reads far lower. That tells you which outer lead is the collector.
The transistor testing lesson goes through it step by step.
What we'd do
Keep BC547B for signal work and loads under about 50 mA, where its high gain helps. Use the 2N2222A for anything from 100 mA to about 300 mA driven by a pin, and size the base resistor from the 15 mA test point. Reach for the 2N3904 when you want the faster, lower-capacitance part at small currents, or when it's simply what you have. When you swap between the C-B-E part and the E-B-C pair, turn the transistor around.
Questions people ask
Is the 2N2222 an equivalent of the BC547?
For switching under 100 mA, yes, as long as you turn it around: the Diotec 2N2222A is E-B-C and the BC547 is C-B-E. The 2N2222A takes far more current (600 mA against 100 mA) but has lower gain at small currents.
Can I use a 2N3904 instead of a BC547?
Yes, for most hobby circuits. The pins are mirrored, the current rating is double (200 mA against 100 mA) and the voltage rating is slightly lower (40 V against 45 V VCEO).
What is the difference between the 2N2222 and the 2N3904?
Current. Both are 40 V NPN parts with the same E-B-C order in Diotec's TO-92, but the 2N2222A is rated for 600 mA and specified as a switch up to 500 mA, while the 2N3904 is rated for 200 mA and specified as a switch up to 50 mA. The 2N3904 has the lower capacitance (4 pF against 8 pF).
Which is better for an Arduino relay?
Check the coil current on the relay's datasheet. Under about 80 mA a BC547 works (example 1); above that, or if you want headroom, use the 2N2222A. Always fit the flyback diode.
Why does my swapped transistor get hot or barely switch?
Usually because it is fitted backwards. With collector and emitter swapped it can't saturate properly, so the voltage across it, and the heat, go up.
Where to go next
Each part has its own page with every package variant: BC547, 2N2222 and 2N3904. For heavier loads, read choosing a MOSFET for Arduino and ESP32. To buy them in India, see where to buy electronic components in India, and check the printed part number and gain letter when the bag arrives.
One email a month from the bench
New circuits, lessons, part guides and calculators, on the first Sunday of each month.
Used in these lessons
Lessons that go deeper
Datasheets this page was checked against
- Diotec Semiconductor, BC546 ... BC549 General Purpose NPN Transistors (Version 2026-03-30)
- Diotec Semiconductor, 2N3904 General Purpose NPN Transistors (Version 2026-03-10)
- Diotec Semiconductor, 2N2222A General Purpose NPN Transistors (Version 2026-03-10)
- Central Semiconductor, 2N2221A, 2N2222A (R5, 5 December 2013)
- onsemi, P2N2222A/D (Rev. 7, January 2013)
Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.