---
title: "Calculates the current-limiting resistor for driving one or more LEDs in series from a DC supply. Computes the exact resistance from R = (Vsupply - n*Vf) / I, then selects the nearest E24 standard resistor value. Reports the actual current with the standard resistor, power dissipation, and voltage across the resistor. Supports series LED strings by specifying led_count. Validates that supply voltage exceeds total forward voltage. Chain from ohms_law for power budgeting or into trace_width for PCB layout."
method: POST
path: "/api/led_resistor"
tags: ["pcb"]
---

# Calculates the current-limiting resistor for driving one or more LEDs in series from a DC supply. Computes the exact resistance from R = (Vsupply - n\*Vf) / I, then selects the nearest E24 standard resistor value. Reports the actual current with the standard resistor, power dissipation, and voltage across the resistor. Supports series LED strings by specifying led_count. Validates that supply voltage exceeds total forward voltage. Chain from ohms_law for power budgeting or into trace_width for PCB layout.

`POST /api/led_resistor`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/led_resistor`
- Auth: none declared

## Request body

- object
  - `supply_voltage_v` number, required: Supply voltage in volts (V). Must be positive.
  - `led_forward_v` number: LED forward voltage in volts (V). Defaults to 2.0V (typical red LED).
  - `led_current_ma` number: Desired LED current in milliamps (mA). Defaults to 20mA.
  - `led_count` number: Number of LEDs in series. Defaults to 1.

## Response `200`

Computed result for led_resistor

- object
  - `result` object, required
    - `resistance_ohm` number, required: Exact calculated resistance in ohms.
    - `nearest_e24_ohm` number, required: Nearest standard E24 series resistor value in ohms.
    - `power_dissipation_mw` number, required: Power dissipated by the resistor in milliwatts (mW), using the E24 value.
    - `actual_current_ma` number, required: Actual LED current in milliamps (mA) when using the nearest E24 resistor.
    - `voltage_across_resistor_v` number, required: Voltage drop across the current-limiting resistor in volts.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
