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

  1. Run the design rules check (Inspect → Design Rules Checker) and clear the errors.
  2. Refill all zones (Edit → Fill All Zones, shortcut B), so copper pours are exported filled.
  3. 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…).

  1. Plot format: Gerber.
  2. Output directory: your clean folder, e.g. gerbers/.
  3. Layers: tick every layer the board uses:
    • F.Cu, B.Cu and every inner copper layer (In1.Cu, In2.Cu…)
    • F.Mask, B.Mask
    • F.Silkscreen, B.Silkscreen
    • F.Paste, B.Paste if you're ordering assembly or a stencil
    • Edge.Cuts, the board outline
  4. 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.
  5. 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 .gbrjob lists 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.
  6. 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….

  1. Output folder: the same gerbers/ folder.
  2. Drill file format: Excellon.
  3. PTH and NPTH in single file: leave off unless your manufacturer wants one file. Two files keep plated and non-plated holes clearly apart.
  4. 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.
  5. Map file format: Gerber X2 or PDF, if you want a drill map for people to read. Optional.
  6. Drill origin: the same choice as in the Plot dialog (see above).
  7. Drill units: millimetres.
  8. Zeros format: Decimal format. It's the least ambiguous, so every viewer reads the coordinates the same way.
  9. Click Generate Drill File (some versions label it Generate).

Package and check

  1. ZIP the contents of gerbers/: the Gerber files, the drill file(s) and the job file.
  2. 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.
  3. Upload to your manufacturer and compare its preview with what you saw.

If something looks wrong

Symptom in the viewerKiCad setting to check
Holes all offset by the same amountDrill origin vs Use drill/place file origin
Holes scaled or scatteredDrill units and zeros format (use mm and decimal)
A layer is missingThat layer wasn't ticked in Plot
Ground pour missing or outlinedZones not filled: refill, or tick Check zone fills before plotting
Outline has gapsLines on Edge.Cuts don't meet: fix in the PCB Editor
Viewer puts files on the wrong layersTurn 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.