# Resistor Color Code Calculator

> Decodes the colour bands of a 4-band or 5-band resistor (IEC 60062) into its resistance, tolerance and min/max values, or encodes a resistance value into the 4-band (or 5-band) colour sequence.

- Calculator id: `resistor-color-code` · Category: Engineering & Automotive (`engineering`) · Tool name: `convert_resistor_color_code`
- Canonical page: https://tttkmbb.com/engineering/resistor-color-code · This document: https://tttkmbb.com/engineering/resistor-color-code.md · JSON definition: https://tttkmbb.com/engineering/resistor-color-code.json

## Purpose

Decodes the colour bands of a 4-band or 5-band resistor (IEC 60062) into its resistance, tolerance and min/max values, or encodes a resistance value into the 4-band (or 5-band) colour sequence.

**Use when:** You need to read a resistor's bands (band colours in, ohms out) or find the bands for a given resistance value.

**Do not use when:** The part is an SMD resistor with a printed numeric code, a 6-band resistor (temperature coefficient band is ignored), or you need the resistor value for a circuit (use led-resistor or voltage-divider).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `band1` | enum: black \| brown \| red \| orange \| yellow \| green \| blue \| violet \| grey \| white |  | optional | First significant digit colour (band nearest the end). |
| `band2` | enum: black \| brown \| red \| orange \| yellow \| green \| blue \| violet \| grey \| white |  | optional | Second significant digit colour. |
| `band3` | enum: black \| brown \| red \| orange \| yellow \| green \| blue \| violet \| grey \| white |  | optional | Third significant digit colour for 5-band resistors; omit for 4-band. |
| `multiplier` | enum: black \| brown \| red \| orange \| yellow \| green \| blue \| violet \| grey \| white \| gold \| silver |  | optional | Multiplier colour: black ×1, brown ×10, red ×100, orange ×1k, yellow ×10k, green ×100k, blue ×1M, violet ×10M, grey ×100M, white ×1G, gold ×0.1, silver ×0.01. |
| `tolerance` | enum: brown \| red \| green \| blue \| violet \| grey \| gold \| silver \| none |  | optional, default "gold" | Tolerance colour: brown ±1 %, red ±2 %, green ±0.5 %, blue ±0.25 %, violet ±0.1 %, grey ±0.05 %, gold ±5 %, silver ±10 %, none ±20 %. |
| `resistance_ohm` | number | Ω | optional | Give a resistance in ohms (e.g. 4700) to get its colour bands instead of decoding; band inputs are then ignored. (> 0, max 100000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `mode` | string |  | 'decode' (colours → value) or 'encode' (value → colours). |
| `resistance_ohm` | number | Ω | Nominal resistance. |
| `resistance_formatted` | string |  | Nominal resistance with SI prefix, e.g. 4.7 kΩ. |
| `tolerance_percent` | number | % | Tolerance from the tolerance band. |
| `min_resistance_ohm` | number | Ω | Nominal × (1 − tolerance). |
| `max_resistance_ohm` | number | Ω | Nominal × (1 + tolerance). |
| `band_count` | integer |  | 4 or 5. |
| `band_colors` | string_list |  | Colours from the first digit band to the tolerance band. |
| `color_code` | string |  | The bands as a hyphen-separated string, e.g. yellow-violet-red-gold. |

## Formula

`4-band: R = (10·d1 + d2) × multiplier; 5-band: R = (100·d1 + 10·d2 + d3) × multiplier; digits black 0 … white 9; min/max = R × (1 ∓ tolerance/100)`

## Data Sources

- Wikipedia – Electronic color code (IEC 60062) — https://en.wikipedia.org/wiki/Electronic_color_code (reference, retrieved 2026-09-24)
- Digi-Key – Resistor color code calculator and reference (4, 5 and 6 bands) — https://www.digikey.com/en/resources/conversion-calculators/conversion-calculator-resistor-color-code (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/resistor-color-code?`
- `POST https://tttkmbb.com/api/v1/calculate/resistor-color-code` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/resistor-color-code · OpenAPI operationId `convert_resistor_color_code` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "resistor-color-code", "inputs": {…}}`

## Example

- 5-band brown-black-black-red-brown: inputs `{"band1":"brown","band2":"black","band3":"black","multiplier":"red","tolerance":"brown"}` → `{"mode":"decode","resistance_ohm":10000,"resistance_formatted":"10 kΩ","tolerance_percent":1,"min_resistance_ohm":9900,"max_resistance_ohm":10100,"band_count":5,"color_code":"brown-black-black-red-brown"}`
- Encode 4.7 kΩ ±5 %: inputs `{"resistance_ohm":4700}` → `{"mode":"encode","band_count":4,"band_colors":["yellow","violet","red","gold"],"color_code":"yellow-violet-red-gold","min_resistance_ohm":4465,"max_resistance_ohm":4935}`

```
GET https://tttkmbb.com/api/v1/calculate/resistor-color-code?band1=brown&band2=black&band3=black&multiplier=red&tolerance=brown
```

## Limitations

The part is an SMD resistor with a printed numeric code, a 6-band resistor (temperature coefficient band is ignored), or you need the resistor value for a circuit (use led-resistor or voltage-divider). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Which end do I read from?**

The tolerance band (gold, silver or a band set apart by a wider gap) is last; read from the opposite end. Gold or silver can never be a first band.

**Why can't a value be encoded?**

Colour bands hold only 2 (4-band) or 3 (5-band) significant digits and a power-of-ten multiplier down to ×0.01. Values like 4735 Ω or 0.047 Ω have no exact code; round to a preferred (E-series) value.

## Related

- [LED Resistor Calculator](https://tttkmbb.com/engineering/led-resistor.md) — Find the resistor value you need before reading its bands.
- [Resistors in Series and Parallel Calculator](https://tttkmbb.com/physics/resistors-series-parallel.md) — Combine several decoded resistors.
- [Ohm's Law Calculator](https://tttkmbb.com/physics/ohms-law.md) — Use the decoded value in V = I·R.
