KiCad PCB Panelization with Javascript
Simple online tool builds a framework to panelize your PCB in KiCad v5, ready for manufacture
How to use it
- Enter the Dimensions (width * height in mm) of your PCB design
- Enter the Panel Format: the number of PCBs in the panel along (x), and down (y). This will calculate the total Panel Size for you, including the fixed-size rails and mousebites
- Click Download .kicad_pcb and save the file to your local drive
- Run KiCad’s Pcbnew directly, not from the KiCad launcher. This unlocks the menu option File→Append Board... and use that to import the
.kicad_pcbfile from inside your PCB design project folder. Click to place it anywhere - Use Place→Grid Origin and click on the exact top-left corner of your PCB (in case your board isn’t already aligned with the current grid)
- Edit the
Edge.Cutslayer lines around your design to be on theDwgs.Userlayer instead: this is so that you can see the edge for aligning it inside the panel, but the lines won’t be used for cutting - Use File→Append Board... to import
generic-panel.kicad_pcbthat you downloaded. Place it away from your PCB design - Drag around your PCB design to select it, and move it to exactly match the space for it in the top-left corner of the panel. Don’t clear the selection yet. The video below shows the rest of this process, starting at +24:13
- Finally, right click and use Create Array... to copy your design to each space in the panel. Enter Horizontal/Vertical counts from the Panel Format values, and the Horizontal/Vertical spacing should be your x/y Dimensions + 3mm
If you use JLCPCB.com to order a metal stencil along with your panel, you can choose their Customized size option and enter the Panel Size values. This means the stencil is shipped within the package of panels, saving you money.
Why panelize a PCB?
The main reason to order your PCBs in a panel is for small production runs where you want to apply solder paste (using a stencil), add components and reflow solder multiple boards at once. Fab houses can design a panel for you, but you may want to specify the exact design so that it fits your stencil jig, pick'n'place machine or reflow oven.Some fab houses also offer slightly lower prices per PCB if you order them in panels.
3D-printed Stencil alignment jig
If you have a metal stencil (for applying solder paste) then you may want to make a jig for accurate alignment of the stencil over each panel. Below is a simple jig design written in JSCAD. Just copy'n'paste it into the OpenJSCAD.org site and press F5 to render the jig. You can then save it as an STL file ready for 3D printing.
function main() {
return union(
cube({size:[202,104,3]}),
cylinder({r:1.975, h:4}).translate([10,5,3]),
cylinder({r:1.975, h:4}).translate([202-10,5,3])
);
}
Creating the panel by hand
You can of course create panels by hand. In this tutorial video Kevin Neubauer goes through the entire process, from creating the panel to ordering with JLCPCB.com. Note how Kevin draws thick 3mm lines in theEco1.User layer to denote cuts instead of drawing outlines in Edge.Cuts. His method is quicker when drawing by hand, but does mean writing an explanatory note to the fab house:
Panelizing Your Circuit Design with KiCad
I’ve taken the liberty of tidying up his Panelization footprints (consistency of spacing/positions) and put them into a zip archive for easy downloading.
Other panelization software
My simple script can only panelize square/rectangular designs so you may prefer to use one of these other panelization tools, which offer far more flexibility & features. However they all require downloading & installing extra software and can have quite restrictive requirements: particular OSes, libraries, other tools, etc.- kicad panelize by Martin Furter. Single Python3 script with no dependencies. Can populate frames created by this page, automating steps 4→9 above
- GerberPanelizer by ThisIsNotRocketScience. Windows, 90MB, requires .NET framework v4.8 (110MB download), works directly with Gerber files so compatible with any verson of KiCad, Eagle, etc.
- KiCad Panelization Made Easy by Jan Mr�zek. Python3 PyPi package with many dependencies that also get installed. “No module named 'pcbnew'” error means it needs a very specific environment. The author suggests using a Docker image but that requires huge downloads. e.g. Docker Toolbox and VirtualBox
- Panelizing Boards In KiCad by Flemming Frandsen. Java app, requires Java v8 (90MB download)
Future improvements
- Integrate within Pcbnew with an Action Plugin?
- Wider intermediate mousebites? (JLCPCB has 5mm minimum)
- Improve stencil jig design? raised edge at base+edges to hold in place, with open corners for lifting stencil+PCB
- Option for V-scoring?
- Adjustable rail dimensions
- Units configurable in mm/inches
- Option to output older KiCad v4 files? what does this need, if anything?
- Load stencil jig into OpenJSCAD.org with a single click, needs v2.0
Changelog
- Added fiducials to panel rails for using pick'n'place machines
- Added intermediate mousebites to support larger PCBs
Nikki Smith, September 2020. Last updated April 2021.

