Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.
How to Generate Gerber and Drill Files in KiCad: Complete Guide for All Versions (5.x to 9.x)
You’ve spent hours perfecting your PCB layout in KiCad, double-checked every trace, and finally passed DRC with zero errors. Now comes the part that trips up more beginners than any other step: generating Gerber and drill files that your fab house can actually use.
I’ve been designing boards with KiCad since version 4, and I can tell you that while the interface has evolved significantly through versions 5, 6, 7, 8, and now 9, the fundamental process remains consistent. This guide covers everything you need to know about exporting manufacturing files from any KiCad version, with specific notes on where the versions differ.
Understanding Gerber and Drill Files in PCB Manufacturing
Before we dive into button clicks, let’s understand what we’re actually creating. When you send your design to a PCB manufacturer, they don’t open your .kicad_pcb file. Instead, they need industry-standard formats that their CAM systems can process.
Gerber files (RS-274X format) are essentially 2D vector images describing each layer of your PCB. Think of them as high-precision stencils that tell the fab house where to put copper, solder mask, and silkscreen on each layer.
Drill files (Excellon format) define every hole in your board, including via positions, component through-holes, and mounting holes. Without drill files, your PCB would be a solid slab with no way to mount components or make layer-to-layer connections.
Files Required for PCB Manufacturing
File Type
KiCad Layer
Typical Extension
Purpose
Top Copper
F.Cu
.GTL
Top layer traces and pads
Bottom Copper
B.Cu
.GBL
Bottom layer traces and pads
Inner Layers
In1.Cu, In2.Cu…
.G2, .G3…
Internal copper layers (multilayer boards)
Top Solder Mask
F.Mask
.GTS
Areas without solder mask (top)
Bottom Solder Mask
B.Mask
.GBS
Areas without solder mask (bottom)
Top Silkscreen
F.SilkS
.GTO
Component labels and markings (top)
Bottom Silkscreen
B.SilkS
.GBO
Component labels and markings (bottom)
Top Paste
F.Paste
.GTP
Stencil openings for solder paste (top)
Bottom Paste
B.Paste
.GBP
Stencil openings for solder paste (bottom)
Board Outline
Edge.Cuts
.GKO / .GM1
Physical board boundary
Drill File
—
.DRL / .XLN
All hole positions and sizes
Pre-Export Checklist: What to Do Before Generating Gerbers
Rushing through Gerber generation is a recipe for rejected files or worse, boards that don’t work. Here’s what I check before every export.
Run Design Rule Check (DRC)
This is non-negotiable. KiCad’s DRC catches clearance violations, unconnected nets, and other issues that could make your board unfabricated or non-functional.
In the PCB Editor, navigate to Inspect → Design Rules Checker (or press the DRC icon in the toolbar). Address all errors before proceeding. Warnings deserve attention too, though some can be safely waived with documentation.
Refill All Copper Zones
Outdated zone fills are one of the most common Gerber problems. If you’ve made changes since last filling your copper pours, your Gerber files won’t match what you see on screen.
Press B to refill all zones, or go to Edit → Fill All Zones. In KiCad 7 and later, you can enable “Check zone fills before plotting” in the Plot dialog as a safety net.
Verify Your Board Outline
The Edge.Cuts layer must form a completely closed shape. Even a tiny gap will cause your fab house to reject the files or make assumptions about your board shape.
Zoom in on corners and check for discontinuities. KiCad’s DRC can catch some outline issues, but a visual inspection is always worthwhile.
Check Manufacturer Specifications
Different fab houses have different capabilities. Before exporting, verify your design meets their specifications for minimum trace width, spacing, hole sizes, and annular rings. JLCPCB, PCBWay, OSH Park, and other services publish their capabilities online. Catching a problem now is infinitely cheaper than discovering it after ordering.
Step-by-Step Gerber Generation in KiCad (All Versions)
The core workflow is identical across KiCad 5.x through 9.x, though menu locations and options have been refined over time.
Step 1: Open the Plot Dialog
In the PCB Editor (Pcbnew), access the Gerber export dialog:
KiCad Version
Menu Path
KiCad 5.x
File → Plot
KiCad 6.x
File → Fabrication Outputs → Gerbers (.gbr)…
KiCad 7.x
File → Fabrication Outputs → Gerbers (.gbr)…
KiCad 8.x
File → Fabrication Outputs → Gerbers (.gbr)…
KiCad 9.x
File → Fabrication Outputs → Gerbers (.gbr)…
You can also click the Plot icon in the toolbar (looks like a page with lines).
Step 2: Set the Output Directory
At the top of the Plot window, specify where KiCad should save your Gerber files. I recommend creating a dedicated subfolder within your project directory, such as “Gerbers” or “CAM_Output.”
Simply type the folder name in the Output Directory field. KiCad will create it automatically if it doesn’t exist. This keeps your manufacturing files organized and separate from your design files.
Step 3: Select Layers to Export
On the left side of the Plot window, you’ll see checkboxes for all available layers. For a standard two-layer board, select these layers:
Essential layers for all boards:
F.Cu (Front Copper)
B.Cu (Back Copper)
F.Mask (Front Solder Mask)
B.Mask (Back Solder Mask)
F.SilkS (Front Silkscreen)
B.SilkS (Back Silkscreen)
Edge.Cuts (Board Outline)
Additional layers for SMD assembly:
F.Paste (Front Paste Mask)
B.Paste (Back Paste Mask)
For multilayer boards, add:
In1.Cu, In2.Cu, etc. (all inner copper layers)
Step 4: Configure Plot Options
The General Options section contains critical settings. Here’s what I recommend for maximum compatibility:
Option
Recommended Setting
Notes
Plot Format
Gerber
Required for manufacturing
Use Protel filename extensions
✓ Checked
Most fabs prefer .GTL, .GBL format
Generate Gerber job file
✓ Checked
Creates metadata file (KiCad 6+)
Subtract soldermask from silkscreen
✓ Checked
Prevents silkscreen on pads
Check zone fills before plotting
✓ Checked
Safety net for outdated fills
Plot reference designators
✓ Checked
Shows component IDs on silkscreen
Plot footprint values
Typically unchecked
Usually clutters the silkscreen
Coordinate format
4.6 (unit mm)
High precision, wide compatibility
Step 5: Configure Gerber Options
Under Gerber Options, these settings matter for fab compatibility:
Use Extended X2 format: This enables the newer Gerber X2 format with embedded layer metadata. Most modern fabs support it, but if you’re unsure, you can leave it unchecked for maximum compatibility with RS-274X.
Include Netlist Attributes: Adds electrical net information to Gerbers. Useful for advanced DFM checking, but not required by most fabs.
Disable Aperture Macros: Leave unchecked unless your fab specifically requests it. Aperture macros allow complex pad shapes.
Step 6: Generate the Gerber Files
Click the Plot button at the bottom of the dialog. KiCad will generate one Gerber file per selected layer and display a log showing each file created. Keep this window open; we need it for drill files.
Generating Drill Files in KiCad
Don’t close the Plot dialog yet. The drill file generation happens from the same window.
Step 1: Open Drill File Dialog
Click the Generate Drill Files… button at the bottom of the Plot window. This opens a separate dialog specifically for NC drill output.
Step 2: Configure Drill File Settings
The output folder should automatically match your Gerber output directory. Configure these settings:
Setting
Recommended Value
Explanation
Drill File Format
Excellon
Industry standard
Drill Units
Millimeters
More precise than inches
Zeros Format
Decimal format
Most compatible option
Drill Origin
Absolute
Use board origin as reference
Drill Map File Format
Gerber
Human-readable drill legend
Mirror Y Axis
Unchecked
Only for special cases
Step 3: Handle PTH and NPTH Holes
KiCad can generate separate files for Plated Through Holes (PTH) and Non-Plated Through Holes (NPTH), or merge them into one file.
Merge PTH and NPTH holes into one file: Check this option if your fab prefers a single drill file. Most budget fabs like JLCPCB work fine with merged files. Leave unchecked if your manufacturer specifically requests separate files.
Step 4: Configure Oval Holes Drill Mode
For slots and oval holes, you have two options:
Use route command: Creates actual routed slots (recommended for most fabs)
Use alternate drill mode: Uses multiple hits to approximate slots
Most modern fabs handle routed slots correctly, but check with your manufacturer if you have complex slot geometries.
Step 5: Generate Drill Files
Click Generate Drill File. KiCad will create one or more drill files depending on your settings.
Optionally, click Generate Map File to create a visual drill map showing hole positions and sizes. This is useful for verification and fab house communication.
Version-Specific Differences in KiCad Gerber Export
While the core process is consistent, here are the key differences across KiCad versions:
KiCad 5.x Specifics
Menu path is simply File → Plot
“Include extended attributes” option should typically be disabled for older fab systems
Older coordinate format options (2.4, 3.3)
No job file generation
Zone fills must be manually refreshed before export
KiCad 6.x Changes
Reorganized menu under Fabrication Outputs
Added Gerber X2 format support
Introduced Gerber job file generation
Improved zone fill checking option
Better default settings for most fabs
KiCad 7.x Improvements
Streamlined Plot dialog interface
Better layer selection presets
Command-line interface (kicad-cli) for automated exports
Improved X2 format support
“Plot board edge on all layers” option
KiCad 8.x Updates
Enhanced “Tent vias” option for solder mask
Improved file naming conventions
Better error reporting during generation
More intuitive default settings
KiCad 9.x New Features
Jobsets feature for batch output generation
Refined plotting options interface
Some options moved to Board Setup (like via tenting)
Improved IPC-2581 support as alternative to Gerber
Enhanced CLI export capabilities
Verifying Your Gerber Files Before Ordering
Never send Gerbers to a fab house without verification. I’ve caught errors in probably 20% of my exports over the years, and checking takes just five minutes.
Using KiCad’s Built-in GerbView
KiCad includes GerbView, a dedicated Gerber viewer. From the KiCad project window, click the GerbView icon.
File → Open Gerber Plot File(s) and select all your Gerber files
File → Open Excellon Drill File(s) and load your drill files
Toggle layers on/off to inspect each one
Use the measurement tools to verify dimensions
Third-Party Gerber Viewers
For additional verification, especially DFM analysis, consider these tools:
Tool
Platform
Cost
Key Features
Gerbv
Windows/Linux
Free (Open Source)
Layer viewing, measurements, PNG export
ViewMate
Windows
Free version available
Professional features, easy interface
ZofzPCB
Windows
Free with paid options
3D visualization, realistic renders
HQDFM (NextPCB)
Online
Free
DFM analysis, 20+ automated checks
Ucamco Reference Viewer
Online
Free
Official Gerber format validator
Altium Online Viewer
Online
Free
Multiple format support, sharing
Verification Checklist
Before ordering, confirm:
All required layers are present and populated
Board outline forms a closed shape
Drill holes align with pad centers
Copper features appear correctly (no missing traces)
Solder mask openings expose the correct pads
Silkscreen doesn’t overlap with pads or vias
No unexpected artifacts or stray geometry
Inner layers (if applicable) show correct routing
Common Gerber Generation Problems and Solutions
After years of helping fellow engineers debug their Gerber exports, these are the issues I see most frequently.
Missing or Empty Layers
Symptom: A layer Gerber file is created but appears blank in the viewer.
Cause: The corresponding KiCad layer contains no objects, or zone fills are outdated.
Solution: Verify design content exists on that layer. Refill all zones with B key before plotting.
Drill Holes Don’t Align with Pads
Symptom: In the Gerber viewer, drill hits appear offset from pad centers.
Cause: Mismatched origin settings between Gerber and drill file exports.
Solution: Ensure both exports use “Absolute” origin. Verify coordinate format matches between both file types.
Silkscreen Overlapping Pads
Symptom: Reference designators or graphics cover SMD pads.
Cause: Component placement too tight, or silkscreen not clipped.
Solution: Enable “Subtract soldermask from silkscreen” in Plot options. Also consider repositioning designators in your layout.
Fab House Reports Invalid Board Outline
Symptom: Manufacturer rejects files due to missing or invalid board boundary.
Cause: Edge.Cuts layer has gaps, multiple shapes, or isn’t included in export.
Solution: Check that Edge.Cuts forms a single closed polygon. Zoom in on corners to find gaps. Verify Edge.Cuts is selected for export.
Large File Sizes
Symptom: Gerber files are unexpectedly large (tens of MB).
Cause: Complex copper pours with excessive vertices, or incorrect arc resolution.
Solution: Simplify zone boundaries where possible. Check coordinate format precision settings (4.6 is typically sufficient).
Outdated Zone Fills
Symptom: Gerber files show copper pour different from what’s displayed in KiCad.
Cause: Zones weren’t refilled after recent design changes.
Solution: Always press B to refill zones before export. Enable “Check zone fills before plotting” as a safeguard.
Can I upload my .kicad_pcb file directly instead of generating Gerbers?
Some manufacturers like OSH Park accept native KiCad files and handle the Gerber conversion for you. This reduces the chance of export errors. However, most professional fab houses expect Gerber files, and generating them yourself gives you more control over the output. You can also verify the files before ordering, catching issues that would otherwise cause delays.
What’s the difference between RS-274X and Gerber X2 format?
RS-274X (Extended Gerber) is the traditional format that’s universally supported. Gerber X2 adds embedded metadata like layer function, material type, and board thickness information. Most modern fab houses support X2, and it can improve automated processing. When in doubt, RS-274X works everywhere. KiCad 6 and later support both formats.
Why do I get separate PTH and NPTH drill files?
KiCad separates plated through-holes (vias, component holes) from non-plated through-holes (mounting holes, slots) because they require different manufacturing processes. Most budget manufacturers can work with merged files, but having separate files gives the fab house clearer instructions. Check the “Merge PTH and NPTH holes into one file” option if your manufacturer prefers combined output.
How do I generate Gerbers for a 4-layer or 6-layer board?
The process is identical to a 2-layer board, but you must select all inner copper layers (In1.Cu, In2.Cu, etc.) in addition to F.Cu and B.Cu. Each inner layer generates its own Gerber file. Also include a stackup document or README specifying your layer order and any impedance requirements, as Gerber files don’t communicate stackup information directly.
Can I automate Gerber generation in KiCad?
Yes, starting with KiCad 7, the kicad-cli command-line tool supports automated Gerber and drill file generation. This is useful for continuous integration pipelines or batch processing multiple designs. KiCad 9 introduces “Jobsets” that let you define a set of outputs (Gerbers, drill files, BOMs, PDFs) and generate them all with a single click, making repeat exports much faster.
Final Thoughts
Generating Gerber and drill files from KiCad is straightforward once you understand the process and the settings that matter. The key is preparation: run DRC, refill zones, and verify your board outline before export. Then configure your settings once, verify the output in a Gerber viewer, and you’re ready to order.
Whether you’re using KiCad 5, 6, 7, 8, or 9, the fundamentals remain the same. The newer versions simply make the process more intuitive and add features like batch job generation. Stick with proven settings for your fab house, always verify before ordering, and you’ll get boards that work on the first spin.
Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Notes: For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.