i want to use the transistor to turn an LED on and off, the transistor will be connected to a 9v 200mah battery and i think that LED can have maximum input of 5v and 25ma.
atteched you can find the a screenshot of the datasheet of the LED, i have a green one.
A green led will have a forward voltage of around 2.2v to 2.4v , it would be silly to power it with a 9v battery because majority of the battery power would be wasted as heat in the resistor that limits the current.
You limit the current going through the led using formula derived from Ohm's law : Input voltage - (number of leds in series x forward voltage of led) = Current x Resistance
Your input voltage will be 9v , minus around 0.2-0.4v in the transistor, between collector and emitter.
If you want to limit the current to 20mA (0.02A) and you use 2.2v for the forward voltage of the led, then your formula becomes 9v - 0.4v - 1 led x 2.2v = 0.02A x R so R = 6.4/0.02 = 320 ohm ... I'd probably use 330 ohm and get a bit less than 20mA through the led.
The problem is you're gonna waste a lot of energy in the resistor : Power = Current
2xR = 0.02 x 0.02 x 320 = 0.128 watts .... while your led will consume 2.2v x 0.02A = 0.044 watts
Change your battery to 2 AA rechargeable batteries (2.4v) or 2 alkaline batteries (3v) and not only you'll have more energy, you'll also waste less in the resistor.
With rechargeable batteries you'd have R = (2.4v - 2.2v ) / 0.02A = 10 ... so a 10 ohm resistor would be perfect, and the power wasted in resistor would be 0.004 watts
You want to use the transistor as an on/off switch, you won't use it to limit the current. So even with a hFe of 25 you'd get the transistor going with as little as 1mA on the base.
Assuming same batteries are used to turn transistor on or off
Input voltage - ~0.6v drop on the base = Current x Resistance ... for 1mA you'd have R = (2.4v - 0.6v) / 0.001A = 1800 ohm ... so even with a 1kOhm, you'd get more than 1mA on the base.