Exporting Gerbers from KiCad so they open correctly anywhere
The KiCad plot settings and drill file settings that produce a Gerber package any online Gerber viewer, and any manufacturer, reads correctly.
Last reviewed
KiCad's PCB Editor writes Gerbers through its Plot dialog and drill files through Generate Drill Files. The defaults are sensible, but a few settings decide whether the output lines up in every viewer. Setting names below are from recent KiCad versions (7, 8 and 9); older versions use slightly different names for the same things. Your manufacturer may publish its own recommended settings: where they differ from these, follow theirs.
Before you plot
- Run the design rules check (Inspect → Design Rules Checker) and clear the errors.
- Refill all zones (Edit → Fill All Zones, shortcut B), so copper pours are exported filled.
- Make a clean output folder, for example
gerbers/, so old files from earlier revisions can't slip into the ZIP.
Plot settings
Open File → Fabrication Outputs → Gerbers (.gbr)… (or File → Plot…).
- Plot format: Gerber.
- Output directory: your clean folder, e.g.
gerbers/. - Layers: tick every layer the board uses:
F.Cu,B.Cuand every inner copper layer (In1.Cu,In2.Cu…)F.Mask,B.MaskF.Silkscreen,B.SilkscreenF.Paste,B.Pasteif you're ordering assembly or a stencilEdge.Cuts, the board outline
- General options:
- Leave Plot drawing sheet off.
- Keep reference designators on the silkscreen if you want them printed.
- Tick Check zone fills before plotting so stale pours can't be exported.
- Subtract soldermask from silkscreen keeps ink off bare pads; most fabs do this anyway.
- Gerber options:
- Use extended X2 format (recommended): on, unless your manufacturer asks for X1. X2 files carry their layer and side inside the file, so viewers place them correctly whatever the filename.
- Include netlist attributes: on, so viewers that read X2 can show nets.
- Generate Gerber job file: on. The
.gbrjoblists every file and the layer order. - Use Protel filename extensions: only if your manufacturer asks for
.GTL/.GBL-style names. - Coordinate format: 4.6, unit mm.
- Click Plot. Check the messages panel for warnings.
Use the same origin for Gerbers and drill
The Use drill/place file origin option in the Plot dialog must match the Origin setting in the drill dialog. If the Gerbers use the page origin and the drill file uses the drill/place origin (or the other way round), every hole will be offset by the same amount in the viewer. Pick one and use it for both.
Drill file settings
In the same Plot dialog, click Generate Drill Files….
- Output folder: the same
gerbers/folder. - Drill file format: Excellon.
- PTH and NPTH in single file: leave off unless your manufacturer wants one file. Two files keep plated and non-plated holes clearly apart.
- Oval holes drill mode: the default works for most manufacturers; if slots come out as round holes in the viewer, check what your fab asks for.
- Map file format: Gerber X2 or PDF, if you want a drill map for people to read. Optional.
- Drill origin: the same choice as in the Plot dialog (see above).
- Drill units: millimetres.
- Zeros format: Decimal format. It's the least ambiguous, so every viewer reads the coordinates the same way.
- Click Generate Drill File (some versions label it Generate).
Package and check
- ZIP the contents of
gerbers/: the Gerber files, the drill file(s) and the job file. - Open the ZIP in an online Gerber viewer and work through the checklist: file count, outline, holes against pads, board size, pours, mask and silkscreen.
- Upload to your manufacturer and compare its preview with what you saw.
If something looks wrong
| Symptom in the viewer | KiCad setting to check |
|---|---|
| Holes all offset by the same amount | Drill origin vs Use drill/place file origin |
| Holes scaled or scattered | Drill units and zeros format (use mm and decimal) |
| A layer is missing | That layer wasn't ticked in Plot |
| Ground pour missing or outlined | Zones not filled: refill, or tick Check zone fills before plotting |
| Outline has gaps | Lines on Edge.Cuts don't meet: fix in the PCB Editor |
| Viewer puts files on the wrong layers | Turn on X2 format, or use the filenames your viewer expects |
Keep the project with the Gerbers
The Gerbers are what gets built; the KiCad project is what you'll need to fix or change the board. Keeping both together means anyone reviewing the order can open the design behind it. BoardRepo opens KiCad projects in the browser (schematic, PCB, 3D and BOM) with saved versions you can compare. See Gerber files versus design source files.