You finished the layout. Now the fab wants a set of Gerbers and a drill file, and KiCad gives you two clean ways to produce them: click through the Plot dialog, or run kicad-cli from a terminal. This walks through both, plus the layers a fab actually needs and the mistakes that cost you a day.
Short answer: In the GUI, use File → Plot to export the copper, mask, silk, and Edge.Cuts layers, then click Generate Drill Files for the drill data. From a terminal, run kicad-cli pcb export gerbers and kicad-cli pcb export drill. Zip the whole folder and send it to the fab.
What Gerbers and drill files are
Gerbers are the industry-standard image format for PCB fabrication. Each file describes one physical layer of your board — one for top copper, one for bottom copper, one for the top solder mask, and so on. The fab stacks these images to build the board.
Drill files are separate. They tell the fab where to drill holes and vias, and at what diameter. KiCad exports these in Excellon format. Gerbers describe the layers; the drill file describes the holes. You need both, and they are generated by two different steps.
Export Gerbers the GUI way
Open your board in the PCB Editor, then:
- File → Plot. The Plot dialog opens.
- Set Plot format to Gerber.
- Pick an Output directory — use a dedicated folder like
gerbers/so nothing else gets mixed in. - In the layer list, select the layers your fab needs (see the table below). Leave Use Protel filename extensions checked unless your fab asks otherwise.
- Keep Plot on all layers options at KiCad's sensible defaults — most fabs are happy with them. Make sure Subtract soldermask from silkscreen is on so silk over pads is trimmed.
- Click Plot. KiCad writes one Gerber per selected layer.
Do not close the dialog yet. You still need the holes.
Generate drill files
In the same Plot dialog, click Generate Drill Files. In the drill dialog:
- Set the Drill file format to Excellon (the default).
- Choose the same
gerbers/output folder so everything ships together. - Leave the drill origin and units at their defaults unless your fab specifies otherwise.
- Click Generate Drill File.
You now have a complete set: Gerbers plus an Excellon drill file, all in one folder.
Export Gerbers from the command line with kicad-cli
KiCad ships kicad-cli, a command-line tool that produces the same outputs without opening the GUI. This is how you script exports, run them on a server, or regenerate a package the instant your design changes.
Export the Gerbers:
kicad-cli pcb export gerbers --output gerbers/ board.kicad_pcb
Export the drill files:
kicad-cli pcb export drill --output gerbers/ board.kicad_pcb
That is the whole flow. By default kicad-cli pcb export gerbers plots a standard set of layers; if you need to control exactly which layers go out, the command accepts a --layers option so you can name specific layers instead of the defaults. Run kicad-cli pcb export gerbers --help to see the layer syntax for your version.
The command line is worth learning because it is reproducible. The same command produces the same package every time, with no dialog to misclick.
Which layers a fab needs
For a standard two-layer board, this is the set almost every fab expects. Multi-layer boards add the inner copper layers (In1.Cu, In2.Cu, and so on).
| Layer | What it is | Needed? |
|---|---|---|
| F.Cu | Top copper | Yes |
| B.Cu | Bottom copper | Yes |
| F.Mask | Top solder mask | Yes |
| B.Mask | Bottom solder mask | Yes |
| F.Silkscreen | Top silk (labels, outlines) | Yes |
| B.Silkscreen | Bottom silk | Yes |
| Edge.Cuts | Board outline / cutouts | Yes |
| F.Paste / B.Paste | Solder paste (stencil) | Only for a stencil |
| Drill (Excellon) | Hole positions and sizes | Yes |
If you skip Edge.Cuts, the fab does not know your board's shape. If you skip a mask or silk layer, the board comes back missing that finish. When in doubt, include the seven core layers above plus the drill file.
Zip it for the fab
Fabs want a single archive, not loose files. Once your gerbers/ folder holds the Gerbers and the drill file, zip the whole folder and upload that. Keep every file in one flat folder — do not nest subdirectories, and do not rename files after export, because the extensions identify each layer.
A quick sanity check before you zip: open the folder and confirm you see the copper, mask, silk, and Edge.Cuts files and a .drl drill file. If the drill file is missing, you forgot the second step.
Protel vs default file extensions
KiCad offers two naming schemes for Gerber files:
- Protel extensions name files by layer function:
.gtl(top copper),.gbl(bottom copper),.gts(top mask), and so on. Older, but universally recognized. - Default KiCad extensions append
.gbrwith a descriptive layer name in the filename. More readable, occasionally tripping up older fab software.
Both are valid. If you are unsure, leave Use Protel filename extensions checked — it is the safest choice for the widest range of fabs, and it is what most order portals expect.
Common mistakes
A few errors show up again and again:
- Forgetting the drill file. Gerbers alone have no holes. This is the number-one hold-up on orders. Always run the drill export as its own step.
- Missing a layer. Skipping Edge.Cuts or a mask layer produces a board that is the wrong shape or missing a finish. Check your set against the table above.
- Wrong origin. If the Gerber origin and drill origin do not match, holes land off from pads. Keep both exports on the same origin setting.
- Renaming or nesting files. The extensions and flat structure are how the fab maps files to layers. Zip the folder as-is.
Let GoForFab run the export for you
Doing this by hand every revision is exactly the kind of repetitive work that drifts out of sync — a Gerber set from one commit, a drill file from another. GoForFab runs these same kicad-cli exports automatically on every push, so a complete, current manufacturing package is always waiting for you: Gerbers, drill files, BOM, CPL, and DRC reports. It is free forever for solo projects.
Once you have the Gerbers and drill file, the next piece a fab or assembler asks for is the pick-and-place file — see how to generate a CPL / pick-and-place file in KiCad. Export it once by hand to understand it; then let it happen on every push.