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)

Advertisement

Pinout by package

BC547 TO-92 · Diotec1=C 2=B 3=E
flat facetoward youC1 CollectorB2 BaseE3 Emitter

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))

2N3904 TO-92 · Diotec1=E 2=B 3=C
flat facetoward youE1 EmitterB2 BaseC3 Collector

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))

2N2222A TO-92 · Diotec1=E 2=B 3=C
flat facetoward youE1 EmitterB2 BaseC3 Collector

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.

BC547flat faceC1B2E32N3904flat faceE1B2C32N2222Aflat faceE1B2C3Base in the middle on all three; C and E swap sides.Turn an E-B-C part 180° to fit a C-B-E footprint.
Figure 1. Flat face toward you, leads down. The base is always in the middle; collector (red) and emitter (blue) swap sides between the BC547 and the other two.

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

Absolute maximum ratings, from each maker's datasheet
ParameterBC547TO-922N3904TO-922N2222ATO-92
Collector-emitter voltage, base open VCEO45 V40 V40 V
Collector-base voltage VCBO50 V60 V75 V
Emitter-base voltage VEBO5 V6 V6 V
Collector current, continuous IC100 mA200 mA600 mA (Central TO-18: 800 mA)
Power dissipation at 25 °C Ptot500 mW625 mW625 mW (Central TO-18: 500 mW)
Thermal resistance, junction to air RthAunder 200 K/W200 K/W typ200 K/W typ (Central TO-18: 350 °C/W)
Junction temperature, max Tj150 °C150 °C150 °C
Electrical characteristics at 25 °C (guaranteed limits unless marked typical)
ParameterBC547TO-922N3904TO-922N2222ATO-92
DC current gain hFEeach sheet uses its own test point110-220 (A), 200-450 (B), 420-800 (C) at 2 mA, 5 V100-300 at 10 mA, 1 V100-300 at 150 mA, 10 V
Saturation voltage, max VCE(sat)IC / IB as listed250 mV at 10 / 0.5 mA; 600 mV at 100 / 5 mA0.2 V at 10 / 1 mA; 0.3 V at 50 / 5 mA0.3 V at 150 / 15 mA; 1 V at 500 / 50 mA
Transition frequency fT300 MHz typ300 MHz min250 MHz min (Central: 300 MHz min)
Collector-base capacitance, max CCBO6 pF4 pF8 pF
PNP partnerBC5572N39062N2907A

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.

rated ICsaturation specified toBC547100 mA100 mA2N3904200 mA50 mA2N2222A600 mA500 mA10 mA100 mA1 A
Figure 2. Rated continuous collector current (grey) against the highest current each datasheet gives a saturation limit at (blue). Design to the blue bar if the part is a switch.

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.

01020304050BC547at 100 mA5 mA2N3904at 50 mA5 mA2N2222Aat 150 mA15 mA2N2222Aat 500 mA50 mAbase current the datasheet names, mA
Figure 3. The base current behind each guaranteed saturation figure. The 2N2222A's 500 mA point needs 50 mA into the base, more than a typical microcontroller pin is rated to source.

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.

R1 220 Ω Q1 2N2222A R2 load 33 Ω +5 V 5 V pin
Figure 4. Example 2 as built: a 5 V pin through 220 Ω into a 2N2222A, with a 33 Ω load from 5 V. Simulated with the maker's SPICE model: 18.3 mA into the base, 0.18 V across the transistor, 146 mA through the load. Add a diode across the load if it is a relay coil or motor.

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.

limitEx. 1 BC54748 mW+9.6 °CEx. 2 2N2222A45 mW+9 °CEx. 3 2N2222A0.5 W+100 °C0+125 °Crise above a 25 °C room at 200 K/W
Figure 5. Temperature rise in the three examples against the 125 °C between a 25 °C room and the 150 °C junction limit. Examples 1 and 2 barely register; example 3 uses 80 percent of it.

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

Pin order read with the flat face toward you, leads down, left to right
PartPinsVerdict
2N3904 or 2N2222A for a BC547E-B-CFine 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 2N2222AC-B-EOnly 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 2N2222AE-B-CSame 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 2N2222AC-B-ESold 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
Advertisement

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

  1. 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.
  2. Reverse the probes: both junctions should read open, and the two outer leads should read open both ways.
  3. 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.

Advertisement

One email a month from the bench

New circuits, lessons, part guides and calculators, on the first Sunday of each month.

We'll send one email to confirm. Every email has a one-click unsubscribe. Privacy policy

Used in these lessons

Lessons that go deeper

Datasheets this page was checked against

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.