A resistor color code is an ordered marking, not an unordered palette. Choose the physical reading direction first, then assign each position its role. Four bands carry two significant digits; five and six bands carry three. The next band scales that integer, while tolerance and optional TCR describe separate properties.
Read roles before multiplying
In a four-band code, positions one and two are digits, position three is the multiplier, and position four is tolerance. Yellow is 4 and violet is 7, so yellow–violet starts with 47. Red as multiplier means 10², giving 47 × 100 = 4700 Ω. Gold tolerance means ±5%. In five or six bands, one additional significant digit appears before the multiplier.
Do not guess orientation from software
Physical spacing and a separated tolerance band can help a person orient a familiar resistor, but not every body or marking is equally clear. ResistorCode requires the user to state left-to-right order and rejects black as the first significant digit. It does not inspect a photograph or claim that a mathematically valid combination identifies a real part. Confirm unusual markings against the manufacturer datasheet.