Resistor Color Code / SMD Code Decoder
embedcalc_resistor_codeDecode through-hole resistor color bands or SMD markings into resistance and tolerance values.
Instructions
Decode a through-hole resistor color code (4 or 5 bands) or an SMD resistor marking into ohms + tolerance.
Args (one of):
bands: array of 4 or 5 color names in order (black, brown, red, orange, yellow, green, blue, violet, grey, white, gold, silver, none).
smd_code: 3-digit ('472'=4.7k), 4-digit ('4702'=47k), R-notation ('4R7'=4.7Ω), or EIA-96 ('01C'=10k ±1%).
Returns (structured): { ohms, tolerance_percent, min_ohms, max_ohms }. Example: ['brown','black','red','gold'] -> 1000 Ω ±5%.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bands | No | Color band names in order (4 or 5 bands) | |
| smd_code | No | SMD marking, e.g. '472', '4R7', '01C' |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ohms | Yes | ||
| max_ohms | Yes | ||
| min_ohms | Yes | ||
| tolerance_percent | Yes |