Contact Sales & After-Sales Service

Contact & Quotation

  • 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.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

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 ElementDescriptionExample
Tool TableDrill bit diameters usedT1C0.300 (0.3mm drill)
X,Y CoordinatesPosition of each holeX015000Y025000
Tool SelectionWhich drill to useT01
Units HeaderMetric or ImperialMETRIC,LZ
Format InfoCoordinate precisionFMAT,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:

SettingRecommended ValueNotes
Drill File FormatExcellonIndustry standard
Mirror Y AxisUncheckedLeave unchecked unless specifically required
Minimal HeaderUncheckedFull header improves compatibility
PTH and NPTH in single fileDepends on manufacturerSee section below
Oval Holes Drill ModeUse alternate drill modeBetter slot handling

Step 5: Configure Drill Units

Choose your coordinate units:

OptionWhen to Use
MillimetersMetric designs, most international fabs
InchesImperial 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:

OptionDescriptionRecommendation
AbsoluteUses KiCad’s page origin (top-left)Default, works for most cases
Drill/place file originUses the auxiliary origin you setBetter 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:

FormatDescriptionRecommendation
Decimal formatFull decimal notationMost compatible, recommended
Suppress leading zerosRemoves leading zerosCommon alternative
Suppress trailing zerosRemoves trailing zerosLess common
Keep zerosNo suppressionMaximum 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 TypeFull NameDescriptionExamples
PTHPlated Through-HoleCopper-plated barrelVias, through-hole component leads
NPTHNon-Plated Through-HoleNo copper platingMounting 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:

SettingResultWhen to Use
CheckedOne combined .drl fileFabs that prefer single file (OSH Park, etc.)
UncheckedSeparate .drl and -NPTH.drl filesFabs 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

ModeHow It WorksCompatibility
Use route commandG00 routing for oval holesBest for complex slots
Use alternate drill modeG85 command for slotsGood 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

  1. Verify slot dimensions meet your fab’s minimum requirements
  2. Check that slot end radii match available drill sizes
  3. Include slot callouts in your fabrication notes
  4. 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:

  1. Select your preferred Map File Format:
FormatDescriptionUse Case
GerberStandard Gerber formatBest for Gerber viewers
PostScriptVector graphicsPrinting, documentation
PDFPortable documentEasy viewing/sharing
SVGScalable vectorWeb, documentation
DXFAutoCAD formatCAD integration
  1. 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:

  1. Open GerbView from KiCad’s main project window
  2. File → Open Excellon Drill File(s)
  3. Load your .drl file(s)
  4. Load your Gerber files for comparison
  5. Verify holes align with pads

External Verification Tools

ToolPlatformCostFeatures
GerbvWindows/LinuxFreeOpen source, reliable
ViewMateWindowsFree versionProfessional quality
Tracespace ViewWebFreeBrowser-based
JLCPCB ViewerWebFreeDirect upload verification
PCBWay ViewerWebFreeManufacturing preview

Verification Checklist

Before submitting to your manufacturer:

  1. All holes visible and in correct positions
  2. Holes centered on pads (no offset)
  3. PTH holes appear on signal pads and vias
  4. NPTH holes appear on mounting holes only
  5. Slot positions and orientations correct
  6. Drill report shows expected tool sizes
  7. 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:

CauseSolution
Mismatched origin settingsUse same origin for Gerber and drill export
Different unitsEnsure both use same units (mm or inches)
Auxiliary origin not setSet 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:

VersionNotable Features
KiCad 5.xBasic Excellon export, separate PTH/NPTH option
KiCad 6.xImproved dialog, better format options
KiCad 7.xGerber X2 drill format option, refined UI
KiCad 8.xEnhanced format support, IPC-2581 export
KiCad 9.xLatest improvements, better defaults

If you’re using an older version, the general process remains similar, but some options may be in slightly different locations.

Best Practices for NC Drill File Management

File Naming Conventions

Use clear, descriptive names:

FileSuggested Name
PTH drillProjectName.drl or ProjectName-PTH.drl
NPTH drillProjectName-NPTH.drl
Drill mapProjectName-drl_map.gbr
Drill reportProjectName-drl_report.txt

Manufacturing Package Organization

ProjectName_Fabrication/├── ProjectName-F_Cu.gtl├── ProjectName-B_Cu.gbl├── ProjectName-F_Mask.gts├── ProjectName-B_Mask.gbs├── ProjectName-F_Silkscreen.gto├── ProjectName-B_Silkscreen.gbo├── ProjectName-Edge_Cuts.gm1├── ProjectName.drl├── ProjectName-NPTH.drl (if separate)├── ProjectName-drl_map.gbr (optional)└── README.txt (fab notes)

Version Control

Include your fabrication outputs in version control:

  • Track changes to export settings
  • Maintain history of sent-to-fab packages
  • Enable rollback if issues discovered

Useful Resources for KiCad Users

Official Documentation

ResourceURLDescription
KiCad Documentationkicad.org/docsOfficial user manual
KiCad Forumforum.kicad.infoCommunity support
KiCad GitLabgitlab.com/kicadSource and issues

Drill File Viewers

ToolAccess
Gerbvgerbv.github.io
ViewMatepentalogix.com
Tracespacetracespace.io/view
Reference Gerber Viewergerber-viewer.ucamco.com

Manufacturer Guidelines

Most PCB manufacturers provide specific export guides for KiCad:

  • JLCPCB: jlcpcb.com/help (search “KiCad”)
  • PCBWay: pcbway.com/blog (KiCad tutorials)
  • OSH Park: docs.oshpark.com/design-tools/kicad
  • Eurocircuits: eurocircuits.com (design guidelines)

Frequently Asked Questions

What drill file format should I use in KiCad?

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

FeatureKiCadAltiumEagleOrCAD
Excellon ExportYesYesYesYes
PTH/NPTH SeparationOptionOptionManualOption
Gerber X2 DrillYes (7.0+)YesNoYes
Built-in ViewerGerbViewCAMtasticLimitedYes
Slot SupportG85G85LimitedG85
CostFree$$$$$$$$$

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 TypeLayer SpanDrill File Behavior
Through-holeFull stackMain .drl file
Blind (top)Top to innerSeparate drill file
Blind (bottom)Inner to bottomSeparate drill file
BuriedInner to innerSeparate drill file
MicroviaAdjacent layersLaser 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.

Basic KiBot Configuration for Drill Files

yaml

outputs:  – name: ‘drill_files’    type: ‘excellon’    options:      metric_units: true      pth_and_npth_single_file: false      use_aux_axis_as_origin: true      output: ‘%f-%i.%x’

Benefits of Automation

BenefitDescription
ConsistencySame settings every time
SpeedGenerate all outputs with one command
CI/CD IntegrationAutomate in build pipelines
Error ReductionNo manual setting mistakes

KiBot is available at: github.com/INTI-CMNB/KiBot

Manufacturer-Specific Export Tips

Different fabricators have different preferences. Here are tips for popular services:

JLCPCB Settings

SettingJLCPCB Preference
PTH/NPTHEither (merged OK)
UnitsMillimeters
FormatDecimal
OriginAbsolute

OSH Park Settings

SettingOSH Park Preference
PTH/NPTHMerged preferred
Format2:4 or 3:3
Binary .DRLNot recommended

PCBWay Settings

SettingPCBWay Preference
PTH/NPTHSeparate files OK
UnitsEither (specify in notes)
SlotsG85 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:

  1. Run DRC before generating any fabrication outputs
  2. Match settings between Gerber and drill exports (origin, units)
  3. Use Excellon format with decimal zeros for best compatibility
  4. Know your manufacturer’s requirements for PTH/NPTH separation
  5. Always verify your outputs before sending to fabrication
  6. 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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • 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.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

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.