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 NC Drill Files in KiCad: Complete PCB Engineer’s Guide
KiCad has become my go-to PCB design tool for both personal projects and professional work. It’s free, open-source, and genuinely capable of handling complex multilayer designs. But here’s something I’ve noticed after helping dozens of engineers transition to KiCad: the drill file generation process trips people up more than it should.
This guide walks you through everything you need to know about generating NC drill files in KiCad, from basic exports to handling tricky scenarios like oval holes and PTH/NPTH separation.
Understanding NC Drill Files and the Excellon Format
Before diving into KiCad’s interface, let’s establish what we’re actually creating. NC drill files (Numerical Control drill files) contain the precise instructions that CNC drilling machines need to place every hole in your PCB. The coordinates, tool sizes, and drilling sequences are all encoded in these files.
KiCad exports drill data in Excellon format, which is the industry standard accepted by virtually every PCB fabricator worldwide. You’ll sometimes hear this called “NC drill” or simply “drill files” — they’re all referring to the same thing.
What Information NC Drill Files Contain
Data Element
Description
Example
Tool Table
Drill bit diameters used
T1C0.300 (0.3mm drill)
X,Y Coordinates
Position of each hole
X015000Y025000
Tool Selection
Which drill to use
T01
Units Header
Metric or Imperial
METRIC,LZ
Format Info
Coordinate precision
FMAT,2
Pre-Export Checklist: Before Generating NC Drill Files
Running through this checklist before exporting has saved me countless headaches over the years.
Run Design Rule Check (DRC)
Always run DRC before generating any fabrication outputs. In KiCad’s PCB Editor:
Inspect → Design Rules Checker
Fix any errors related to:
Minimum hole sizes
Drill-to-copper clearances
Via annular ring violations
Overlapping holes
Verify Zone Fills Are Current
If your copper pours are outdated, KiCad will prompt you during export. Save yourself the interruption by refilling zones first:
Edit → Fill All Zones (or press B)
Check Your Board Origin
The drill origin setting determines the reference point for all hole coordinates. Inconsistent origins between Gerber and drill files cause the most common alignment problems I see from KiCad users.
Step-by-Step Guide: Generate NC Drill Files in KiCad
Step 1: Access the Plot Dialog
With your PCB design open in PCB Editor, navigate to:
File → Fabrication Outputs → Gerbers (.gbr)
This opens the Plot dialog. While primarily for Gerber generation, the drill file export is accessed from this same window.
Step 2: Open the Drill File Generator
At the bottom right of the Plot dialog, click:
Generate Drill Files…
This opens the dedicated drill file configuration dialog where you’ll set all the critical parameters.
Step 3: Configure Output Folder
The output folder defaults to the same location as your Gerber files, which is usually what you want. If you need a different location, click the folder icon to browse.
Recommended Practice: Keep all fabrication outputs (Gerbers and drill files) in the same folder for easier packaging when submitting to manufacturers.
Step 4: Configure Drill File Format Settings
This is where the critical decisions happen. Here are the recommended settings for most PCB fabricators:
Setting
Recommended Value
Notes
Drill File Format
Excellon
Industry standard
Mirror Y Axis
Unchecked
Leave unchecked unless specifically required
Minimal Header
Unchecked
Full header improves compatibility
PTH and NPTH in single file
Depends on manufacturer
See section below
Oval Holes Drill Mode
Use alternate drill mode
Better slot handling
Step 5: Configure Drill Units
Choose your coordinate units:
Option
When to Use
Millimeters
Metric designs, most international fabs
Inches
Imperial designs, some US-based fabs
Critical: Your drill file units should match your Gerber file units for best results.
Step 6: Set Drill Origin
The drill origin determines the coordinate reference point:
Option
Description
Recommendation
Absolute
Uses KiCad’s page origin (top-left)
Default, works for most cases
Drill/place file origin
Uses the auxiliary origin you set
Better for precise alignment
If you’ve set a drill/place origin on your board (using Place → Drill/Place File Origin), select “Drill/place file origin” here for consistent alignment with your Gerber files.
Step 7: Configure Zeros Format
Zero suppression affects file size and compatibility:
Format
Description
Recommendation
Decimal format
Full decimal notation
Most compatible, recommended
Suppress leading zeros
Removes leading zeros
Common alternative
Suppress trailing zeros
Removes trailing zeros
Less common
Keep zeros
No suppression
Maximum compatibility
Decimal format is the safest choice and what most modern CAM systems expect.
Step 8: Generate the Drill Files
Click Generate Drill File to create your output files. KiCad will generate:
Main drill file (.drl extension)
Separate NPTH file if applicable (-NPTH.drl)
Report file with hole summary
Watch the message area at the bottom of the dialog for confirmation that files were created successfully.
Understanding PTH vs. NPTH Drill Files
One of the most common questions I get about KiCad drill files concerns the PTH/NPTH separation.
What Are PTH and NPTH Holes?
Hole Type
Full Name
Description
Examples
PTH
Plated Through-Hole
Copper-plated barrel
Vias, through-hole component leads
NPTH
Non-Plated Through-Hole
No copper plating
Mounting holes, mechanical features
Separate Files vs. Merged Files
KiCad gives you the option to generate PTH and NPTH holes in separate files or merged into one:
“PTH and NPTH in single file” checkbox:
Setting
Result
When to Use
Checked
One combined .drl file
Fabs that prefer single file (OSH Park, etc.)
Unchecked
Separate .drl and -NPTH.drl files
Fabs that require separation (most professional fabs)
My Recommendation: Check your manufacturer’s requirements. When in doubt, keep them separate — fabs can always merge files, but they can’t always split them correctly.
Handling Oval Holes and Slots in KiCad
Oval holes (slots) require special handling in drill files because they’re not simple circular holes.
Oval Holes Drill Mode Options
Mode
How It Works
Compatibility
Use route command
G00 routing for oval holes
Best for complex slots
Use alternate drill mode
G85 command for slots
Good compatibility
The Use alternate drill mode setting generates slots using the G85 drilled slot command, which creates overlapping holes from start point to end point. This method has excellent compatibility with most fabricators.
Best Practices for Slots
Verify slot dimensions meet your fab’s minimum requirements
Check that slot end radii match available drill sizes
Include slot callouts in your fabrication notes
Verify slots appear correctly in your Gerber viewer
Generating Drill Map Files
Drill map files provide a visual representation of your drill data — extremely useful for verification and for manufacturers who want human-readable documentation.
Creating a Drill Map File
In the same Generate Drill Files dialog:
Select your preferred Map File Format:
Format
Description
Use Case
Gerber
Standard Gerber format
Best for Gerber viewers
PostScript
Vector graphics
Printing, documentation
PDF
Portable document
Easy viewing/sharing
SVG
Scalable vector
Web, documentation
DXF
AutoCAD format
CAD integration
Click Generate Map File
The map file shows drill locations with tool identifiers, making it easy to visually verify your drill data.
Verifying Your KiCad Drill Files
Never send drill files to manufacturing without verification. I’ve caught issues in verification that would have resulted in scrapped boards.
Using KiCad’s Built-in Gerber Viewer
KiCad includes GerbView, a capable Gerber and drill file viewer:
Open GerbView from KiCad’s main project window
File → Open Excellon Drill File(s)
Load your .drl file(s)
Load your Gerber files for comparison
Verify holes align with pads
External Verification Tools
Tool
Platform
Cost
Features
Gerbv
Windows/Linux
Free
Open source, reliable
ViewMate
Windows
Free version
Professional quality
Tracespace View
Web
Free
Browser-based
JLCPCB Viewer
Web
Free
Direct upload verification
PCBWay Viewer
Web
Free
Manufacturing preview
Verification Checklist
Before submitting to your manufacturer:
All holes visible and in correct positions
Holes centered on pads (no offset)
PTH holes appear on signal pads and vias
NPTH holes appear on mounting holes only
Slot positions and orientations correct
Drill report shows expected tool sizes
No missing holes or extra holes
Common NC Drill File Problems and Solutions
Problem 1: Drill Holes Offset from Pads
Symptoms: Holes appear shifted relative to copper pads in viewer
Causes and Solutions:
Cause
Solution
Mismatched origin settings
Use same origin for Gerber and drill export
Different units
Ensure both use same units (mm or inches)
Auxiliary origin not set
Set drill/place origin on board
Problem 2: Missing NPTH Holes
Symptoms: Mounting holes or mechanical features don’t appear
Solutions:
Check “PTH and NPTH in single file” setting
Verify holes are defined as NPTH in footprint
Ensure -NPTH.drl file is included in your fab package
Problem 3: Oval Holes Appearing as Round
Symptoms: Slots render as circular holes
Solutions:
Enable “Use alternate drill mode” for oval holes
Verify pad properties show correct oval dimensions
Check that hole shape is set to “Oval” not “Circular”
Problem 4: Holes Scaled Incorrectly
Symptoms: Entire drill pattern too large or too small
Solutions:
Verify units match between Gerber and drill
Check format settings (decimal vs. suppressed zeros)
Ensure viewer is interpreting format correctly
Problem 5: Manufacturer Rejects Drill Files
Symptoms: Fab house reports format or compatibility issues
Solutions:
Disable “Minimal header” option
Use Decimal format for zeros
Verify Excellon format is selected
Check manufacturer’s specific requirements
KiCad Version Differences for Drill Export
KiCad’s drill export has evolved across versions. Here are the key differences:
Version
Notable Features
KiCad 5.x
Basic Excellon export, separate PTH/NPTH option
KiCad 6.x
Improved dialog, better format options
KiCad 7.x
Gerber X2 drill format option, refined UI
KiCad 8.x
Enhanced format support, IPC-2581 export
KiCad 9.x
Latest improvements, better defaults
If you’re using an older version, the general process remains similar, but some options may be in slightly different locations.
Use Excellon format with Decimal zeros format and Millimeters for units (unless your design is imperial). These settings provide the best compatibility with PCB manufacturers worldwide. Avoid minimal header unless specifically required, as the full header contains useful format information.
Should I merge PTH and NPTH holes into one file?
It depends on your manufacturer. Some fabs like OSH Park prefer a single merged file, while others require separate files for plated and non-plated holes. When in doubt, check your manufacturer’s guidelines or generate separate files — professional fabs can merge them if needed.
Why are my drill holes offset from the pads?
Drill-to-pad offset almost always results from mismatched origin settings between your Gerber and drill exports. Ensure both use the same origin (either Absolute or Drill/place file origin). Also verify that units match between both file types.
How do I export slots and oval holes correctly?
Enable “Use alternate drill mode” in the drill file generation dialog. This uses the G85 drilled slot command to create oval holes properly. Also verify that your pads have the correct oval dimensions defined in their properties.
Does KiCad support blind and buried vias in drill files?
Yes, KiCad supports blind and buried vias for multilayer designs. When you define via types in your layer stackup with specific start/end layers, KiCad automatically generates appropriate drill files for each layer pair. Make sure your via definitions are correct in the board setup before generating outputs.
KiCad NC Drill Export vs. Other PCB Tools
Having worked with multiple PCB design platforms, I can offer perspective on how KiCad’s drill export compares.
Feature Comparison Across Tools
Feature
KiCad
Altium
Eagle
OrCAD
Excellon Export
Yes
Yes
Yes
Yes
PTH/NPTH Separation
Option
Option
Manual
Option
Gerber X2 Drill
Yes (7.0+)
Yes
No
Yes
Built-in Viewer
GerbView
CAMtastic
Limited
Yes
Slot Support
G85
G85
Limited
G85
Cost
Free
$$$$
$$
$$$
KiCad’s Advantages for Drill Export
Simplicity: KiCad’s drill export is accessed from a single, well-organized dialog. No hunting through multiple menus.
Sensible Defaults: Recent KiCad versions ship with reasonable default settings that work for most manufacturers.
Community Support: The active KiCad community means manufacturer-specific export guides are readily available.
Continuous Improvement: Being open-source, KiCad’s export capabilities improve with each release based on user feedback.
Advanced Topics: Multilayer Boards and Via Types
Handling Blind and Buried Vias
For complex HDI designs, KiCad supports multiple via types that require separate drill operations:
Via Type
Layer Span
Drill File Behavior
Through-hole
Full stack
Main .drl file
Blind (top)
Top to inner
Separate drill file
Blind (bottom)
Inner to bottom
Separate drill file
Buried
Inner to inner
Separate drill file
Microvia
Adjacent layers
Laser drill file
When your design includes blind or buried vias, KiCad automatically generates separate drill files for each layer pair. Ensure your via types are properly defined in Board Setup → Board Stackup.
Back Drilling Considerations
For high-speed designs requiring back drilling (controlled depth drilling), you’ll need to coordinate with your manufacturer separately. KiCad’s standard drill export doesn’t include back drill specifications — these are typically handled through fabrication notes and drawings.
Automating Drill File Generation with KiBot
For production environments or repetitive projects, consider using KiBot — a command-line tool for automating KiCad outputs.
Different fabricators have different preferences. Here are tips for popular services:
JLCPCB Settings
Setting
JLCPCB Preference
PTH/NPTH
Either (merged OK)
Units
Millimeters
Format
Decimal
Origin
Absolute
OSH Park Settings
Setting
OSH Park Preference
PTH/NPTH
Merged preferred
Format
2:4 or 3:3
Binary .DRL
Not recommended
PCBWay Settings
Setting
PCBWay Preference
PTH/NPTH
Separate files OK
Units
Either (specify in notes)
Slots
G85 command supported
Always check your specific manufacturer’s current guidelines, as requirements can change.
Conclusion: Reliable NC Drill File Generation in KiCad
Generating NC drill files in KiCad is straightforward once you understand the key settings and their implications. The most important principles to remember:
Run DRC before generating any fabrication outputs
Match settings between Gerber and drill exports (origin, units)
Use Excellon format with decimal zeros for best compatibility
Know your manufacturer’s requirements for PTH/NPTH separation
Always verify your outputs before sending to fabrication
Keep files organized with clear naming conventions
KiCad’s drill file generation has matured significantly over recent versions. What was once a common source of manufacturing issues has become a reliable, well-designed export process. Take the time to understand each setting, verify your outputs, and you’ll have no trouble getting your boards manufactured correctly.
The open-source nature of KiCad means the community continuously improves these features. If you encounter issues, the KiCad forum is an excellent resource where experienced users and developers actively help troubleshoot problems.
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.