Electrical & Electronics

BJT Switch & Base Resistor Calculator

Size NPN or PNP switching base resistors and estimate base current and resistor/transistor dissipation.

01

Your inputs

Drive voltage is the magnitude of Vdrive − Ve: above the emitter for NPN, below for PNP.

Use datasheet saturation values and forced Ic/Ib, not small-signal hFE. Check driver current and thermal ratings. This nominal model ignores tolerances.

02

Your results

Recommended resistor
Ideal resistance
—
Required base current
—
Nominal base current
—
Resistor dissipation—
Estimated transistor dissipation—
Nominal current ratio · Ic/Ib—

Standard resistance is rounded down (0.1 Ω–1 GΩ) to provide at least the required nominal base current.

FormulaIb = Ic / β

Estimate a base resistor for an NPN or PNP switch

Estimate base current and a preferred base resistor for a bipolar transistor used as a switch. Supply load current, a chosen forced current gain and assumed junction voltages. The NPN/PNP selector changes the illustrated connection; calculations use positive voltage magnitudes relative to the emitter. This static model does not verify saturation, switching speed, driver capability or thermal limits for a particular transistor.

Step by step

  1. Choose NPN or PNP and inspect the diagram. Enter the available drive-voltage magnitude relative to the emitter, load current in mA, assumed VBE and assumed VCE(sat).
  2. Choose forced gain Ic/Ib and an E12, E24 or E96 resistor series. Ensure the drive magnitude exceeds the assumed base-emitter voltage so a positive voltage remains across the resistor.
  3. Review ideal and recommended resistance, required and estimated base current, actual forced gain and dissipation. Compare estimated base current with what the driver can supply or sink, then check the transistor and resistor specifications.

Settings and limits

Forced gain and base current
Required base current is Ib = Ic / β, using the forced gain you selected. This ratio is a switching assumption, not an automatic reading of the transistor's small-signal gain. Use junction-voltage assumptions and base-drive conditions appropriate to the actual part and load.
Resistor selection
Ideal resistance is Rb = (Vdrive − VBE) / Ib. The tool rounds downward to a preferred value so calculated base current is at least the requested amount under the entered assumptions. A denser series may reduce the difference; lower resistance also increases driver current and resistor loss.
PNP drive and dissipation
For PNP switching, use the magnitude by which the driver pulls the base below the emitter, not the driver's voltage to ground. Resistor dissipation uses its voltage drop and actual base current. Transistor dissipation includes VCE(sat) × Ic plus VBE × Ib; it excludes switching losses.

Worked example

Select NPN with 5 V drive, 100 mA load current, VBE = 0.7 V, VCE(sat) = 0.2 V, forced gain 10 and E12 values. Required base current is 10 mA, and the ideal base resistor is 430 Ω.

Expected result
Rb*Rb (E12)Ib*IbPRbPQ
430 Ω390 Ω10 mA11.0256 mA47.4103 mW27.7179 mW

The recommended resistor is 390 Ω, giving about 11.0256 mA base current and actual forced gain 9.06977. Resistor dissipation is about 47.4103 mW; estimated transistor dissipation is 27.7179 mW. These figures use the assumed junction voltages rather than predicting them for a real part.

Questions and troubleshooting

Why does this round resistance downward when the LED tool rounds upward?

Here the selected value must supply at least the requested base current in the model. A larger resistor would reduce that current. The LED tool instead limits its estimated LED current, so its preferred-value selection serves a different purpose.

Can I use the resistor directly with a microcontroller output?

Check the calculated base current against the output's source or sink capability and its voltage under load. Also check the transistor's operating conditions and dissipation. The calculator contains no driver model and cannot confirm that the entered drive voltage remains available.

Why is a headroom error shown?

Drive magnitude must be greater than the assumed VBE. Otherwise no positive resistor voltage remains for the required base current. Check the emitter reference, polarity and voltage assumptions; do not compensate by entering a negative resistance.