Calculators
LED series-resistor calculator API
Size the current-limiting series resistor for an LED (R = (Vsupply − Vforward) / Iforward), snapping to the nearest E24 value and reporting resistor power. Answers 'what resistor for a 2V LED at 20mA on 5V','nearest standard resistor for my LED','what wattage resistor does the LED need'.
Price$0.01per request
MethodPOST
Route/v1/calc/eng-led-resistor
StatusLive
MIME typeapplication/json
Rate limit120/minute
CacheNo cache
calcengineeringelectricalledresistorcurrent-limite24hardware
API URL
Integration docshttps://x402.hexl.dev/v1/calc/eng-led-resistorExample request
{
"supplyV": 5,
"forwardV": 2,
"currentMa": 20
}Example response
{
"supplyV": 5,
"forwardV": 2,
"currentMa": 20,
"resistanceOhm": 150,
"nearestE24Ohm": 150,
"resistorPowerW": 0.06,
"formula": "R = (Vsupply - Vforward) / I"
}Input schema
{
"type": "object",
"required": [
"supplyV",
"forwardV",
"currentMa"
],
"properties": {
"supplyV": {
"type": "number",
"description": "supply volts",
"examples": [
5
]
},
"forwardV": {
"type": "number",
"description": "LED forward voltage",
"examples": [
2
]
},
"currentMa": {
"type": "number",
"description": "desired LED current (mA)",
"examples": [
20
]
}
}
}Output schema
{
"type": "object",
"additionalProperties": true
}