What is this?
ResistorCalc helps electrical engineering students find the best combination of components from their available stock to match a target value. Instead of trial and error in the lab, just enter what you have and what you need.
How it works
The solver uses iterative deepening search with combinatorial topology enumeration. In plain English:
- It starts by checking if any single component hits the target within tolerance.
- If not, it tries all pairs, then all triplets, and so on, always checking fewest components first.
- For each candidate subset, it evaluates every possible circuit topology: pure series, pure parallel, and mixed series-parallel configurations.
- For small subsets (up to 4 components), it exhaustively searches all binary-tree topologies. For larger subsets, it uses a hybrid approach with 2-partition mixed topologies.
- The first valid solution found is guaranteed to use the minimum number of components. Among solutions of equal size, the one with the lowest error is chosen.
Supported components
- Resistors: series:
R = R1 + R2, parallel: 1/R = 1/R1 + 1/R2. Displayed with color bands per the IEC 60062 (EIA) standard.
- Inductors: same formulas as resistors. Displayed with coil symbols. Unit: Henry (H).
- Capacitors: formulas are swapped: parallel adds, series uses the reciprocal sum. Displayed with plate symbols. Unit: Farad (F).
Input format
Component values support SI prefixes: k (kilo), M (mega), m (milli), u (micro), n (nano), p (pico). Use x for quantity: 4.7kx5 means five 4.7kΩ resistors.
Algorithm credit
The original optimization concept using Mixed Integer Programming was developed by Michael Jurasovic. This web version ports and extends the idea to JavaScript with a topology-aware combinatorial search, running entirely client-side — no server, no data sent anywhere.
Built by
Fardin Ahsan — originally as a university project to help EE students in circuit labs.
Open Source
This project is open source under the MIT license. View the source code, report issues, or contribute on GitHub.