Markdown circuit diagram maker

Build a circuit schematic on a canvas. Place components and wires, then drop the diagram into your Markdown while keeping it fully editable.

Circuit format

A circuit is written as plain text: one component or wire per line, on a whole-number grid. The editor above reads and writes this same text, so you can type it by hand or build it on the canvas. This format is unique to this tool, so everything it understands is documented here.

The first line

Every circuit starts with the word circuit on its own line. You may follow it with an optional grid line to set how many pixels each grid cell is worth. The default is 44.

You write
circuit
grid 44
resistor 2 1 h "1k"
You get

Placing a component

Write the component name, its grid x and y, then h for horizontal or v for vertical. Coordinates count grid cells, so 3 1 means three cells across and one down. A component sits centred on that point and reaches half a cell to each side for its two terminals.

You write
circuit
resistor 2 1 h
capacitor 2 3 v
inductor 5 1 h
You get

Labels

Add a quoted label after the orientation to name a part or give it a value. The label prints beside the symbol.

You write
circuit
battery 1 2 h "9V"
resistor 4 2 h "220"
led 7 2 h "D1"
You get

Wires

Write wire and two grid points to join terminals. If the points share a row or column the wire is straight, otherwise it turns once (horizontal, then vertical). Chain wires end to end to route around the sheet.

You write
circuit
source 1 3 v "5V"
resistor 4 1 h "R"
wire 1 3 1 1
wire 1 1 4 1
wire 5 1 7 1
wire 7 1 7 3
wire 7 3 1 3
You get

Nodes and junctions

A node is a junction dot. Where a wire ends on a node's grid point the renderer draws a solid connection dot, showing that the wires there are joined rather than just crossing.

You write
circuit
node 3 2 h
wire 1 2 3 2
wire 3 2 5 2
wire 3 2 3 4
ground 3 4 v
You get

Comments

Anything after a # on a line is ignored, so you can annotate the source.

You write
circuit
# power supply
battery 1 2 h "9V"
switch 4 2 h        # on / off
lamp 7 2 h "L1"
You get

Every component

Each of these is a two-terminal symbol you can place with <name> x y h|v ["label"]. ground connects from its single left/top terminal, and node is a bare junction dot.

You write
circuit
resistor 1 1 h "resistor"
capacitor 1 3 h "capacitor"
inductor 1 5 h "inductor"
battery 1 7 h "battery"
source 1 9 h "source"
led 6 1 h "led"
diode 6 3 h "diode"
switch 6 5 h "switch"
lamp 6 7 h "lamp"
ground 6 9 h "ground"
node 9 9 h "node"
You get

Cheat sheet

Write this You get
circuitStart a circuit (required first line)
grid 44Set pixels per grid cell (default 44)
<name> x y hPlace a component horizontally at grid (x, y)
<name> x y vPlace it vertically instead
<name> x y h "text"Place it with a label / value
wire x1 y1 x2 y2Wire two grid points (straight or one bend)
# noteA comment, ignored to the end of the line
resistorZigzag resistor
capacitorTwo parallel plates
inductorCoil of humps
batteryAlternating long / short bars
sourceVoltage source (circle with + / −)
ledDiode with two emission arrows
diodeTriangle and bar
switchHinged lever
lampCircle with a cross
groundThree shrinking bars
nodeA junction dot