Resistor Colour Code Calculator
Resistor colour codes are a base-ten number written in colours, with the last band as a power of ten. This converts a resistance into its bands, decodes them straight back as a check, works out the tolerance window, and shows the nearest value in the E12 series — because a resistor of exactly the value you calculated very likely does not exist.
What this generator does
Splits the resistance into significant digits and a power of ten, maps them to band colours, and then decodes the bands independently to confirm they read back as the same value. It also finds the nearest value in the E12 preferred series.
How to use this tool
- Enter the resistance in ohms.
- Choose the tolerance and the number of bands.
- Read the bands and the value they decode to.
- Check the nearest E12 value — that is what you can actually buy.
Understanding the controls
- Resistance
- In ohms — 4700 for 4.7 kΩ. Values are rounded to the significant digits the band count allows, and the rounding is shown by the decoded value.
- Tolerance
- Brown is 1%, red 2%, gold 5% and silver 10%. The tolerance sets how far the real component may be from its nominal value.
- Bands
- Four bands carry two significant digits, five carry three. Five-band resistors are used where the tighter tolerance makes the extra digit meaningful.
Common use cases
- Working out the bands for a resistance you have calculated
- Checking a resistor you have already read off
- Finding the nearest value that is actually manufactured
- Seeing the tolerance window around a nominal value
- Teaching the colour code with the arithmetic visible
How this generator works
The first bands are the significant digits and the last is the power of ten to multiply by, which is simply scientific notation in colours. Rounding to the available digits can carry into an extra digit — nine million nine hundred thousand to two figures is ten, not ninety-nine — so the multiplier is adjusted when that happens. Before display the bands are decoded independently and compared against the value they were built from, the tolerance window is confirmed to contain the nominal value, and the preferred value is checked to be the genuine nearest across three decades of the series.
Randomness and fairness
Nothing here is random. A resistance and a band count give exactly one code.
For how randomness is produced across the whole site, see how Generate Random works.
Limitations and good to know
- The E12 series only; E24, E48 and E96 have more values per decade and are used for tighter tolerances.
- Temperature coefficient bands, found on some five and six band resistors, are not covered.
- Values are rounded to the digits the band count allows, which the decoded value makes visible.
- Reading bands off a real resistor is harder than this suggests — the colours fade and the direction is not always obvious.
Privacy and your data
The calculation runs in your browser and the resistance you enter is never transmitted, stored or included in analytics.
Related generators
- Checksum Test Number GeneratorA fictional, mod-10-checksum-valid test number, for testing validation code.
- Random Number GeneratorGenerate one or many random numbers within any range, with optional duplicate control and sorting.
- Random Hex Number GeneratorA number shown in hexadecimal, alongside its decimal value for reference.
- Random Binary Number GeneratorA number shown in binary, alongside its decimal value for reference.