A Free Terminal Tool for Resistor Color Codes — No Browser Required
Every electronics workbench eventually has the same pile: unmarked resistors, half-read color bands, and the reflex to open a browser tab just to confirm what you already suspected.
I got tired of that. So I built a CLI tool in pure C++17 that does it in the terminal, with no internet connection, no dependencies, and ANSI color output that actually shows you what the bands look like.
It's called resistor. It's free. MIT license.
What it does
Two directions:
# Value to color bands
resistor -v 4.7k -p 5
# Color bands to value
resistor -c yellow,violet,black,brown,brown
Output:
Your resistor's color code should look like this: [ye][vt][bk][bn][bn]
The resistor value is: 47.0KΩ +/- 1.0%
Valid range: 46.53KΩ - 47.47KΩ
If the measured value is outside this range, return the resistors lot.
You've been scammed!
Supports 4-band and 5-band resistors. Supports engineering notation — 2k2, 4R7, 1M, 470k. Validates tolerance values against the standard IEC series. Shows the valid measurement range so you know when a resistor is out of spec.
Why terminal
Because it's always there. No tab to open, no page to load, no cookie banner. Build it once and it lives in your PATH.
Part of Rosito Bench
resistor is the first public tool in Rosito Bench — a collection of small, dependency-free C++17 CLI utilities for engineers and makers. The second tool in the bench is Hasaki 刃先, which trains neural networks on the desktop and exports standalone C headers for microcontrollers.
Different problems. Same philosophy: do one thing, do it well, no runtime overhead.
GitHub: github.com/AlexRosito67/resistor
If it saves you a browser tab, that's enough.
Top comments (1)
I really like your tool! I sometimes do some electrical engineering (playing around with breadboards), and this could be a big help!