Though most LED light circuits run on low voltages, it is common to require an LED to run in a higher voltage circuit, such as the 12V found in cars. To operate the LED safely, the correct resistor must be calculated to ensure the LED is not overpowered. You will need to know the current rating and forward voltage of your circuit to calculate this, but if these are unavailable, there are a few common figures that can be substituted to provide the same results.
Subtract the forward voltage rating of the LED from the total voltage of the power supply. In this case, it will be 12 volts. Standard LED ratings are 2V for red, yellow and green, and 4.5V for blue. If multiple LEDs will be wired in series, add their voltages together and subtract this number from 12V.
Divide the result by the current rating of your LED. The most common current rating is 30 mA, though this may vary, so always refer to your LED's packaging. The resulting number will give you a resistance in ohms.
Choose a resistor that is equal to or higher than the resistance given as the result of your computations. Wire several resistors together in series to achieve higher resistance ratings, if necessary. In series, the resistances are added together.
Wire the resistor to the positive, longer lead of the LED. The free lead of the resistor is wired to the positive terminal of the power supply. The negative, shorter lead of the LED is wired to the negative terminal of the power supply.