Resistor color code calculator
Enter the color bands from left to right and get the value: brown, black, red, gold is 1000 ohms with a 5 % tolerance. Works for four- and five-band resistors, no chart needed. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Color bands
- brown, black, red, gold
- Number of bands
- 4
- Significant digits
- 10
- Multiplier exponent
- 2
- Resistance (Ω)
- 1000
Enter the color bands of a resistor and get exact ohms plus tolerance.
Four and five band decode only
This calculator reads the color bands of a through-hole resistor from left to right and returns the resistance in ohms plus the tolerance percent. Encode from ohms back to colors is out of scope. Gold and silver are never valid digit colors and fail with digit when placed in a digit position.
Results never call the network, never read the system clock and never depend on host locale settings of any kind.
Canonical color tables
Digit colors map black through white to zero through nine, with grey and gray both accepted. Multiplier uses the same digit colors for powers of ten from zero to nine, plus gold for ten to the minus one and silver for ten to the minus two. Tolerance maps brown one percent, red two, green zero point five, blue zero point twenty-five, violet zero point one, grey zero point zero five, gold five, silver ten and none twenty.
Empty tokens and unknown colors fail with color, digit, multiplier or tolerance as appropriate. Results never call the network, never read the system clock and never depend on host locale settings of any kind.
Exact powers of ten formatting
The significand is built from digit bands as an integer. The resistance string equals significand times ten to the multiplier exponent using only integer arithmetic. Positive exponents yield whole numbers; negative exponents insert a decimal point and strip trailing fractional zeros.
Outputs always include normalized lowercase bands with gray rewritten to grey, bands count, significand, multiplier exponent, resistance ohms and tolerance percent. Results never call the network, never read the system clock and never depend on host locale settings of any kind.
What you can do with it
Bench work
Read a through-hole resistor without a chart.
Homework
Check textbook 4-band and 5-band examples.
Inventory
Normalize band lists in a parts database.
FAQ
Is gray allowed?
Yes. gray and grey are accepted; echo uses grey.
Can gold or silver be a digit band?
No. Gold and silver are never digits; they only work as a multiplier or as the tolerance. As a multiplier, gold divides the value by ten and silver by a hundred, and in a digit position they are rejected.
What tolerance does each color stand for?
Brown stands for 1 %, red 2 %, green 0.5 %, gold 5 % and silver 10 %, and no tolerance band means 20 %. Blue, violet and grey mark even tighter tolerances, below 0.5 %.
Does it read six-band resistors?
No. It accepts exactly four or five bands, made up of two or three digit bands, one multiplier and one tolerance. Any other count is rejected with a message instead of producing a doubtful value.
Can it tell me the colors for a resistance I need?
No. The tool only reads colors and turns them into ohms and tolerance. Going the other way, from a value in ohms to its color bands, is outside what it does.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/dev/resistor-color-code \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"bands":["brown","black","red","gold"]}'const res = await fetch("https://api.kit.forhosting.com/dev/resistor-color-code", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"bands": [
"brown",
"black",
"red",
"gold"
]
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/resistor-color-code",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"bands": [
"brown",
"black",
"red",
"gold"
]
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/resistor-color-code", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"bands":["brown","black","red","gold"]}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"bands":["brown","black","red","gold"]}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/resistor-color-code", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"bands": [
"brown",
"black",
"red",
"gold"
]
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.resistor_color_code",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_bands | 5 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Four and five band decode only
Version one accepts exactly four or five bands: two or three digit colors, one multiplier color and one tolerance color.
Errors you can automate against
Missing bands or a non-array fails with bands. Results never call the network, never read the system clock and never depend on host locale settings of any kind. Lengths other than four or five fail with bands_count.
Integration use cases
CI tests
Pin exact ohm strings in golden files.
Technical questions
Is encode supported?
Not in v1. Decode only.
How many bands?
Exactly four or five.
What about gold as a digit?
Invalid. That returns digit.
Free in the browser?
Yes. API uses $0.002.
Six-band tempco?
Out of scope for v1.