SPICE in the browser: run a deck, import a netlist, export it
- 192parts on the bench
- 25boards running now
- 1.00xreal time, on every board
Mokxi is a free online SPICE simulator: it runs a SPICE deck in your browser, on an engine checked against ngspice, with nothing to install and no account needed. If you have a netlist from a textbook, a class or LTspice and no way to install a simulator on the machine in front of you, this page is for you. Mokxi plots what comes back: transient waveforms, Bode plots, sweeps, noise spectra and measurements. It can also read a .cir, .sp or .spice file onto the canvas as parts and wires, to run with a scope and a meter, and write the analog part of any circuit back out as an ngspice deck.
The circuit above is an RC low pass on the bench, running now: a 1 kHz signal generator into 1.6 k and 100 nF, with both ends on a two-channel scope. The corner is 995 Hz, so the output is 0.705 of the input and an eighth of a cycle behind it. It is the same circuit you would describe in four lines of SPICE.
First, what Mokxi is and is not
Mokxi has two ways to simulate a circuit, and it is worth knowing which one you are using. Run a SPICE deck, in the editor menu, runs a netlist on a SPICE engine: .op, .tran, .ac, .dc with nested sweeps, .tf, .noise and .meas, with .param, .subckt, .include, .temp and .step, and Gummel-Poon transistors, MOSFET levels 1 to 3, JFETs, controlled and behavioral sources, switches and transmission lines. It is checked against ngspice on 42 benchmark circuits, from a divider to a buck converter, and every one agrees within a stated tolerance: 1% or 1 mV for DC values, 0.1 dB for gain, 1% of the range for waveforms.
It does not run MOSFET models above level 3 (the BSIM family), MESFETs, lossy transmission lines, XSPICE devices or the .four, .sens, .pz and .disto analyses, and it has no library of manufacturers’ models; a deck that needs one is told which line. For those, LTspice and ngspice are both free.
On the canvas, where a circuit runs live, the analog parts are solved by the same modified nodal analysis with a diode or LED as a Shockley junction, a transistor as Ebers-Moll and a MOSFET as the level 1 square law, with a transient run, an operating point, sweeps and a frequency response. The canvas op-amp is a single-pole macromodel, and the canvas has no current sources or controlled sources.
What it adds is the bench around the circuit. The signal generator, oscilloscope, multimeter and bench supply are parts you wire in, the circuit sits on a real breadboard, and it can share a canvas with an Arduino or an ESP32 running real firmware.
Import a netlist
In the editor, open Save, then Open JSON or SPICE, and pick your file. A file ending .cir, .sp or .spice is read as a netlist. The importer reads R, C and L with SPICE’s scale suffixes (4.7k, 100n, 10meg); V sources, where a DC source to ground becomes a supply, a floating one a bench supply, SIN and PULSE a signal generator and an AC magnitude a generator you can sweep; D, Q and M elements with their .model cards; and a .tran line, whose maximum step becomes the transient’s longest step.
A model card that names one of Mokxi’s parts comes back as that part. Any other NPN card becomes a 2N2222 with the card’s Bf as its beta, and an NMOS card becomes a 2N7000 with its Vto, Kp and Lambda. A diode card Mokxi does not know becomes the default diode, and its parameters are not carried over.
Nothing is dropped silently. Every line the importer does not read, such as a current source, an E, F, G, H or B source, a switch, a .param or an .include, is listed in the Serial panel, and the note over the canvas has a What button that lists them all. A netlist has no picture, so the importer lays out a first drawing with the sources on the left; it is a starting point to tidy, not a finished schematic.
Run it and measure it
Press Run for a transient, and drop a scope on any two nodes to see them against time. Press Shift+O for the operating point: every net gets a label with its voltage, and a selected part shows its current. Note that this is the operating point at power-on, with capacitors discharged, not SPICE’s .op, which treats a capacitor as open; run the circuit until it settles for the steady answer.
Analysis, in the more menu, runs a DC or parameter sweep of any number you can set, up to 1001 points, and a frequency response that draws gain and phase on a log axis with the minus 3 dB corner marked. Both export to CSV at full precision.
Export to ngspice
Save, then Download SPICE, writes an ngspice deck that runs as it is with ngspice -b circuit.cir. The model cards are the engine’s own, so a 1N4148 in the file has the same parameters as the one Mokxi solved, and each op-amp is a subcircuit carrying its model’s numbers. The file ends with .op and a .tran sized to the circuit.
Anything with no SPICE equivalent is left out with a comment that says why: a board running firmware, a logic gate, a display. Scopes and meters that only watch are listed as comment lines naming the nodes they watch. Export, import and export again gives the same netlist.
That round trip is the useful part for a class. Build and explore a circuit on the bench in a browser, then run the same circuit as a deck, here or in ngspice, for the analyses the canvas does not do.
A four-line netlist to try
Paste this into a text file named rc.cir and open it: V1 in 0 SIN(0 1 1k), R1 in out 1.6k, C1 out 0 100n, and .tran 10u 5m, each on its own line. You get a signal generator, a resistor and a capacitor, wired as the circuit above. Add a scope on in and out and press Run.
Questions
Is there a free online SPICE simulator?
Mokxi is free and runs in a browser. It runs SPICE decks with .op, .tran, .ac, .dc, .tf, .noise and .meas on an engine checked against ngspice on 42 benchmark circuits, and it imports and exports netlists. It has no distortion or Monte Carlo analysis and no BSIM MOSFET models.
Can I open an LTspice file in Mokxi?
A netlist, yes, if it uses the elements Mokxi reads. An LTspice schematic file (.asc) is not a netlist; export the netlist from LTspice first. LTspice’s own models and subcircuits are not carried.
Does it run on a Chromebook?
Yes. It runs in Chrome with nothing to install, which is the main reason to use it over a desktop SPICE on a school machine.
Which SPICE elements does the importer read?
R, C, L, V (DC, SIN, PULSE and AC), D, Q and M with .model cards, X instances of Mokxi’s own op-amp subcircuits, and .tran. Everything else is listed as not read.
Keep going
Build this for real
Open the editor, change a value and watch the number move with it. Nothing to install, and no account needed.