Chris Collins

Tools · electronics

Circuit simulator

Draw a schematic on a grid and simulate it in the browser — DC operating point with node voltages on the drawing, a transient "oscilloscope" with pulse and sine sources, and AC sweeps with Bode plots — then cross-check it against real ngspice (WebAssembly) or run any SPICE netlist.

Added

How to use it

Pick a part from the palette and click the grid to place it; R rotates the selected part, Delete removes it, and dragging moves it. Switch to Wire (or press W) and drag between points — a wire bends once at a right angle, and any wire end or part pin lying on another wire joins it (a dot marks the junction). Every circuit needs a ground. Add voltage probes to name the nodes you want to plot. Values accept engineering notation: 4k7, 100n, 2.2µ, 1meg. Double-click a switch to flip it. Load an example to see the RC, RLC, rectifier, op-amp, oscillator, and transistor-switch circuits.

⛶ Full screen (or F) gives the schematic the whole screen — the browser’s full screen where it is allowed, otherwise a full-window layer (iPhone); the grid grows with the window. On a wide screen the part properties and the analysis tabs sit in a column beside it, and ◫ Panels hides them. Escape leaves.

  • DC operating point — solved continuously as you edit. Capacitors are open and inductors shorted, except a capacitor given an initial voltage, which is held at that voltage. Node voltages appear on the schematic; the table lists the voltage, current, and power of each part.

  • Transient — the time-domain response from the operating point to the stop time. The step is the stop time divided by the number of points, and lands exactly on every pulse edge. Trapezoidal integration is accurate; backward Euler damps the numerical ringing that trapezoidal can show with ideal switches. Tick probes and part currents to plot them, hover to read values, and download the traces as CSV.

  • AC sweep — the small-signal response at a probe for a 1 V (or 1 A) input at the chosen source, with nonlinear parts linearised at the operating point. Gain is in dB, phase unwrapped.

  • SPICE netlist — exports the circuit for ngspice or LTspice, with node 0 as ground.

  • Compare with ngspice (Transient and AC tabs) — runs the same circuit through ngspice, the standard open-source SPICE, compiled to WebAssembly and loaded on first use (about 5.7 MB). Its traces are drawn dashed over this page’s, with a table of the largest difference between the two. Voltage-source currents are compared too; other part currents are this page’s only.

  • SPICE netlist (ngspice) — paste any ngspice netlist (.model cards, .subckt, .param, B-sources) and run it: operating points as a table, transient and DC sweeps as plots of the vectors you tick, AC sweeps as Bode plots. Each analysis line runs separately. Four examples include a common-emitter amplifier with a real 2N2222 model card and a bridge rectifier with 1N4148 diodes; From the schematic fills in the circuit you drew.

How it works: Modified Nodal Analysis builds one equation per node plus one per voltage source, inductor, and op-amp output, solved by Gaussian elimination with partial pivoting. Diodes, LEDs, and transistors are solved by Newton–Raphson with SPICE-style junction voltage limiting, falling back to gmin stepping and source stepping if the first attempt fails. Models: diodes are Shockley (Is, n); LEDs are diodes scaled to drop the listed forward voltage at 10 mA; bipolar transistors are Ebers–Moll (β, Is); the MOSFET is the square-law (level 1) model with channel-length modulation; the op-amp has ideal inputs and a high gain whose output saturates smoothly at the rails; in AC sweeps its gain rolls off with a single pole set by the gain-bandwidth product (1 MHz by default), but the transient model has no slew or bandwidth limit. Switches are 1 mΩ or 1 GΩ.

Sharing. Share link (top right) copies a URL carrying the schematic and the analysis settings (stop time, sweep range, probes), plus the open tab. A built-in example travels by name, and those links can be written by hand: ?ex= takes rc, rlc, rectifier, divider, inverting, astable or ledswitch — for example /tools/circuit-sim/?ex=rlc#ac opens the RLC circuit on its Bode plot.

ngspice is the EEcircuit project’s WebAssembly build (eecircuit-engine 1.8.0, MIT; ngspice itself is BSD-3-Clause), served by jsDelivr and run in a background thread, so nothing leaves your browser. Non-ASCII characters in a netlist are transliterated (µ → u, Ω → ohm) because this build stops on them.

Limits: dense matrices suit circuits up to a few dozen nodes; there is no temperature, breakdown, or parasitic capacitance modelling. Everything runs in your browser, and the schematic is remembered in this browser only — use Save JSON to keep a copy.

Runs entirely in your browser — network requests go only to the services named on this page.