How to generate Gerber and Drill files in KiCAD 9
How to generate Gerber and Drill files in KiCAD 9
In this tutorial, we will explain step by step how to generate the Gerber and Drill files required for PCB manufacturing using KiCAD 9. These files contain all the information JLCPCB needs to fabricate your board, including copper layers, solder mask, silkscreen, and drilling data.
For demonstration purposes, we will use the default KiCad project “royalblue54l”, which comes with the software installation. The same procedure applies to your own PCB projects as well.
1. Manufacturing Capabilities
Before generating the manufacturing files, it’s important to ensure that your PCB design follows JLCPCB’s manufacturing capabilities and design rules. These capabilities include minimum track width, spacing, via sizes, drill diameters, and other critical parameters. You can always find the up-to-date specifications on the JLCPCB Capabilities page.
By setting the correct design rules in KiCad before exporting, you can avoid errors during production and ensure a smooth fabrication process.
2. Generating Gerbers
IMPORTANT - make sure to run DRC check once again before generating the files.
While using PCB editor window open File → Fabrication Outputs → Gerbers (.gbr).
(Figure 1. PCB Fabrication Outputs)
3. Output folder selection
When you start generating Gerber files from the Fabrication Outputs, the Plot window will appear. The first step is to set the output folder location. You can either use the browse icon to select or create a directory, or simply type the desired folder name. KiCad will automatically create the folder if it does not already exist.
(Figure 2. Output folder selection)
4. Layer selection
On the left side of the Plot window, you can choose which layers from your PCB design will be exported into Gerber files.
The following layers should be selected:
⦁ F.Cu
⦁ In1.Cu
⦁ In2.Cu
⦁ In3.Cu
⦁ In4.Cu
⦁ In5.Cu
⦁ In6.Cu
⦁ B.Cu
⦁ F.Paste
⦁ B.Paste
⦁ F.Silkscreen
⦁ B.Silkscreen
⦁ F.Mask
⦁ B.Mask
⦁ Edge.Cuts
(Figure 3. Layer selection)
In KiCAD, layers are named as front and back. Layers with F. (for Front) and B. (for Back), but please note copper layer names can be changed in File → Board Setup.
5. General and Gerber Options
After selecting the required layers, jump to General Options and check these:
⦁ Select Check zone fills before plotting;
⦁ Select Use Protel filename extensions, this is recommended as JLCPCB prefers Protel filename extensions;
⦁ Select Use extended X2 format;
⦁ Select Include netlist attributes;
(Figure 4. Layers and General Options selection)
Now, click the Plot button at the bottom of the window.
All generated Gerbers will be put in the target folder you specified before. If the zone fills are out of date and you forgot to refill them, when Check zone fills before plotting is ticked, KiCAD will ask you to confirm, just click Refill, then the file generation will continue.
6. Generate Drill files
To order PCBs, the Drill files are also required.
After successfully generating the Gerber files with the pressing of the "Plot" button in the bottom right corner, the Plot window will still remain open.
Now press the "Generate Drill files..." button.
The output folder automatically remains the same as for the gerber files.
(Figure 5. Drill Files selection)
Check these options:
⦁ Check Use alternate drill mode for Oval Holes;
⦁ Check Absolute for Drill Origin;
⦁ Check Millimeters for Drill Units;
⦁ Check Decimal format for "Zeros Format;
Click the Generate Drill File button, the drill files will be generated and stored in the output folder.
6. File Verification
Before uploading your Gerber files to JLCPCB for production, it's highly recommended to cross-check the generated files with a 3rd-party Gerber viewer.
When you are checking the file, please pay attention to the following items.
1. Does the board outline exist?
2. Is the board outline watertight(continuous/no gaps)?
3. Do all inner cutouts, unplated slots, V-cut lines show in the GM1 layer correctly?
4. Do all drilling holes shown and are aligned with other layers correctly?
5. Are vias covered or exposed as per your design?
6. And the Silkscreen, do they look good?
If you find any issues, fix them and export the Gerber/Drill files and check them in the Gerber viewer again.
There are some nice Gerber viewers here and there, just use the one you feel handy.
If everything is OK, now you can zip the out folder and place the order.
(Figure 6. JLCPCB Gerber viewer)
Author: Milos Ilic
Software: KiCAD 9.0.4
Conclusion
This comprehensive guide details the step-by-step process for generating industry-standard Gerber and Drill files in KiCad 9, essential for PCB manufacturing, particularly for services like JLCPCB.
The tutorial begins by emphasizing critical preparatory steps: running a Design Rule Check (DRC) and ensuring all copper zones are refilled. The generation process starts in the PCB Editor under File $\rightarrow$ Fabrication Outputs $\rightarrow$ Gerbers (.gbr). Users must select the correct output folder and the required manufacturing layers (e.g., F.Cu, B.Mask, Edge.Cuts). Key settings for compatibility include checking 'Use Protel filename extensions' and 'Plot board edge on all layers.'
Following the Gerber generation, the guide explains how to create the drill data by clicking 'Generate Drill files...'. The recommended settings for drilling include Excellon format, Millimeters for units, Absolute drill origin, and merging PTH and NPTH holes into one file. The process concludes with a strong recommendation for file verification using a Gerber viewer before zipping the final output folder for submission.
Last updated on Oct 31, 2025
Welcome back, may I help you?