DevTools Logo

Resistor Color Code & SMD Decoder

Resistor Color Code & SMD Decoder

Decode 4–6 band resistor colors, convert values into bands, and read SMD markings.

Runs in your browser
Try an example

Color bands

Decoded value

Read the bands from the end with the tolerance band closest to a gap. Temperature coefficient colors vary by manufacturer: check the datasheet.

4.7 kΩ

Tolerance ±5%

Examples

4.7 kΩ through-hole

Input
decodeResistorBands(["yellow", "violet", "red", "gold"])
Output
{ value: 4700, tolerance: 5, formattedValue: "4.7 kΩ" }

Yellow/violet give 47, red multiplies by 100, and gold sets ±5% tolerance.

EIA-96 marking

Input
decodeSmdCode("01C")
Output
{ value: 10000, format: "eia-96", formattedValue: "10 kΩ" }

Index 01 maps to 100 and multiplier C means ×100, yielding 10 kΩ.

About this tool

Resistor SMD Calculator decodes through-hole color bands with decodeResistorBands(bands): 4-band uses 2 digits, 5/6-band use 3 digits, and the result carries value, tolerance, tcr (sixth band only), and formattedValue. The reverse path encodeResistor(value, tolerance, bands, tcr) maps a value back to digit, multiplier, tolerance, and TCR colors.

SMD codes decode with decodeSmdCode(code): 3/4-digit codes read significant digits plus a zero-count multiplier, EIA-96 codes read a 01–96 index plus a Z–H multiplier letter, and "0"/"000" decode as 0 Ω jumpers. Supported digit colors are black–white, multipliers add gold/silver, and tolerances cover 0.05–10%.

Everything is deterministic and client-side: identical bands or codes always return identical values, errors are plain { error } objects, and formatting follows the Ω/kΩ/MΩ/GΩ scale.

How to use this tool

  1. Decode color bands

    Pass 4, 5, or 6 colors in order — e.g. ["yellow", "violet", "red", "gold"] for 4.7 kΩ ±5% — and read value plus tolerance.

  2. Decode an SMD marking

    Enter a 3/4-digit code ("4702" → 47 kΩ), an EIA-96 code ("01C" → 10 kΩ), or "0" for a jumper.

  3. Encode a value

    Call encodeResistor(4700, 5, 4) for the band colors, adding a TCR value (e.g. 100) when requesting 6 bands.

  4. Handle errors

    Branch on the { error } shape for bad band counts, invalid digit/multiplier colors, or unrecognized SMD codes.

Use cases

Reading PCB markings

Translate SMD codes stamped on boards into ohm values during repair or reverse-engineering.

Checking color bands

Verify a 4/5/6-band resistor's value and tolerance before soldering it in.

Documenting BOMs

Encode target values into standard band colors for assembly notes and schematics.

Common mistakes

Mistake:Reading digit bands in reverse order.

Fix:Bands read from the end nearest the edge — tolerance (gold/silver) is last, digits come first.

Mistake:Treating EIA-96 digits as a direct value.

Fix:The two digits are a lookup index (01 → 100), not the value — apply the multiplier letter before reading ohms.

Mistake:Expecting any tolerance on any band count.

Fix:Only the listed 0.05–10% tolerances encode; other values return an unsupported-tolerance error.

Frequently asked questions

What does this tool do?

It decodes through-hole color bands with decodeResistorBands and SMD markings with decodeSmdCode (3/4-digit, EIA-96, and 0 Ω jumpers), and encodes values back to bands with encodeResistor.

What is yellow-violet-red-gold, or EIA-96 01C?

Yellow-violet-red-gold is 47 × 100 = 4.7 kΩ ±5%. EIA-96 01C is index 01 (100) with multiplier C (×100) = 10 kΩ.

Is my data uploaded or stored?

No. Band math, SMD decoding, and formatting run entirely in your browser.

Why did I get an error object?

Band counts must be 4, 5, or 6 with valid digit/multiplier/tolerance colors, and SMD codes must be 3/4 digits or EIA-96 — anything else returns { error } describing the fix.

References & standards