Calculate price
A two-layer board with an ECC83 tube in the KiCad 3D viewer
PCB Manufacturing

How to export Gerber files from KiCad for PCB manufacturing

A step-by-step guide: which layers to tick, which settings to choose and how to export the drill files, so a board from KiCad 9 or 10 goes straight into production.

CircuitNinja5 min

A PCB manufacturer does not need your project. It needs manufacturing data: one Gerber file per layer and drill files for the holes. This guide walks you through exporting them from KiCad 9 or 10 so the board can go straight into production.

The screenshots come from KiCad 10 and the ECC83 demo project that ships with KiCad.

The shortest way: you may not need to export at all

Three ways from a KiCad board to an order: upload the project, use the plugin, or export Gerber files by hand

Before you export by hand, two options save you the work:

  • Upload the KiCad project itself. Put the project folder (the .kicad_pro and .kicad_pcb files) in a ZIP and upload it to the quote calculator. We generate the Gerber and drill files ourselves, with the same settings as this guide.
  • Use the CircuitNinja for KiCad plugin. It sets our manufacturing rules in your project, checks the board, exports the data to one ZIP and uploads it to an order straight from the PCB Editor. It is free, for KiCad 9.0.9.1 and later and 10.x on Windows and Linux.

If you want to export the files yourself, for example for your archive, read on.

1. Check the board

In the PCB Editor, before you export:

  1. Refill the copper zones. Press B (Fill All Zones). Outdated copper zones are the most common cause of a difference between the screen and the finished board.
  2. Run the design rules check (DRC): open Inspect › Design Rules Checker and click Run DRC. Fix the errors, especially unconnected nets and clearance violations.
  3. Check the board outline. The outline must be on the Edge.Cuts layer and must be closed. Without it, we cannot tell where the board ends.
  4. Compare the board with our limits. Track width and the spacing between tracks: at least 0.2 mm. Plated holes (PTH): from 0.3 mm. Annular ring, the copper around a hole: at least 0.12 mm. Board size: from 10 × 10 mm to 155 × 130 mm. The full list is in our PCB manufacturing capabilities.

2. Export the Gerber files

Open File › Fabrication Outputs › Gerbers (.gbr)…. File › Plot… opens the same dialog.

Menu File, Fabrication Outputs, Gerbers in the KiCad PCB Editor
File › Fabrication Outputs › Gerbers (.gbr)…

Leave Plot format on Gerber and set up the dialog as in the picture. The numbers match the list below it.

The KiCad Plot dialog set up for PCB manufacturing
  1. Output directory: type something like gerber/. KiCad creates the folder next to the project, so the files do not mix with your sources.
  2. Include Layers: tick F.Cu and B.Cu (copper), F.Silkscreen and B.Silkscreen, F.Mask and B.Mask (solder mask), and Edge.Cuts (outline). F stands for the front side, B for the back. A four-layer board adds In1.Cu and In2.Cu. F.Paste and B.Paste are only for a solder paste stencil; the bare board does not need them.
  3. Subtract soldermask from silkscreen: on. Silkscreen then stays off the pads.
  4. Use drill/place file origin: off, unless you set the origin on purpose. Gerber and drill files must share the same origin. Keep Plot drawing sheet off and Check zone fills before plotting on.
  5. Gerber Options: turn on three options: Use extended X2 format (each file then says what it contains), Include netlist attributes and Generate Gerber job file. Leave Coordinate format at 4.6, unit mm. Leave Use Protel filename extensions and Disable aperture macros off. KiCad 10 no longer recommends Protel extensions (.GTL, .GBL), but we accept both.
  6. Click Plot.

If you skipped step 1 and the copper zones are out of date, KiCad asks whether to refill them. Choose Refill.

KiCad asking whether to refill outdated copper zones before plotting
Zone fills are out-of-date: choose Refill

Each ticked layer becomes one file. This is what the demo board's layers look like:

Each Gerber layer of a two-layer board: copper, solder mask, silkscreen and outline

3. Export the drill files

In the same dialog, click Generate Drill Files….

The Generate Drill Files dialog set to Excellon, Absolute and Millimeters
  1. Format: Excellon (the standard drill file format). Leave Mirror Y axis, Minimal header, PTH and NPTH in single file, and Use alternate drill mode for oval holes off. Plated (PTH) and non-plated (NPTH) holes then go into two files, which is the default.
  2. Options: Origin Absolute (the same origin as the Gerbers), Units Millimeters, Zeros Decimal format. Keep the output folder the same as for the Gerbers. You do not need Generate map; a drill map only helps you check.
  3. Click Generate. The folder now also holds the -PTH.drl and -NPTH.drl files.

4. Check the result and zip it

Open the files in Gerber Viewer, which comes with KiCad (in the Project Manager). Load the Gerbers and the drill files together. The holes must sit on the pads and the outline must enclose the whole board.

The exported Gerber and drill files loaded in KiCad's Gerber Viewer
Thanks to X2, Gerber Viewer knows what each file contains
  1. Check that the gerber/ folder holds everything: one .gbr file per layer, one .gbrjob file and the -PTH.drl and -NPTH.drl drill files.
  2. Put the whole gerber/ folder in one ZIP. We also accept RAR, 7z and tar.
  3. Upload the ZIP to the quote calculator. We check the board, show you a preview and the price, and you finish the order in your account.

Common mistakes

  • Missing drill files. Gerbers do not contain the holes.
  • Outdated copper zones. Zones that look fine on screen can differ in the manufacturing data. Press B and keep Check zone fills before plotting on.
  • An open outline on Edge.Cuts. A single gap in the outline means the manufacturer cannot tell where to cut the board.
  • Different origins. If the Gerbers and the drill file use different origins, the holes shift off the pads.
  • The drawing sheet on the layers. Plot drawing sheet belongs in a PDF for printing only.

Want it simpler? Upload the KiCad project straight to the calculator, or install the CircuitNinja for KiCad plugin and upload your manufacturing data to an order straight from the PCB Editor.

How Does Ultra-Fast PCB Prototype Manufacturing Work?
PCB Manufacturing

How Does Ultra-Fast PCB Prototype Manufacturing Work?

How we reprogrammed PCB manufacturing: from a sequential production line to a fully autonomous, software-driven system.