Here is a calculator for transistor base resistor values. Its IMPORTANT that you read the following.
Calculate the current you need to pass through the transistor when its on, that is your collector current.
The current gain, beta, Hfe, is a value you can find in the datasheet for the specific transistor.
Supply voltage is the voltage that you use to drive the base of the transistor with.
Voltage drop is the Vbe(sat) value, you will get this from the datasheet looking at the graph for Vbe and Vce(sat) vs. collector current.
To insure to turn the transistor fully on, you can double the value for collector current, which will result in a base resistor value half of what this calculator gives you.
The example values are for a BC547 transistor.