Gerber Files and Drill Files Explained: What Your Fab House Actually Needs

You’ve routed your board, passed DRC, and generated fabrication outputs. Everything’s in the zip file. Probably. But that zip file contains two fundamentally different file types. They follow different format specs, use different coordinate systems, and can silently disagree about units. When they do, your fab house doesn’t build the wrong board. They just email you and wait. And you lose 3 to 5 days.
“Send the Gerbers” is incomplete shorthand. Drill files aren’t Gerbers. Fab notes aren’t optional. And the format you choose for the actual Gerber files determines whether a human at the fab house has to guess which layer is which, or whether the metadata tells them directly.
Here’s how to build a fab package that gets accepted on the first try.
Every File Your Fab House Expects
A complete fab package has three categories: Gerber files (layer images), drill files (hole data), and documentation.
| File Type | Typical Extension(s) | Purpose |
|---|---|---|
| Copper layers | .GTL, .GBL, .G2, etc. | Trace and pour geometry |
| Solder mask | .GTS, .GBS | Mask openings |
| Silkscreen | .GTO, .GBO | Legend/reference designators |
| Paste stencil | .GTP, .GBP | Solder paste apertures |
| Board outline | .GKO / .GM1 | Mechanical boundary |
| Drill file (PTH) | .DRL / .XLN | Plated through-hole locations |
| Drill file (NPTH) | .DRL / .XLN | Non-plated holes |
| Drill map | .DRR / PDF | Visual drill summary |
| Netlist (optional) | .IPC | IPC-D-356 net verification |
| Fab notes / README | .TXT / PDF | Stackup, finish, tolerances |
The paste layers are technically for assembly, not bare-board fabrication. But most engineers bundle them in the same zip for convenience, and fab houses don’t mind.
The critical thing to internalize: drill files are not Gerber files. They follow the Excellon (NC drill) format, which has its own header syntax, its own coordinate scheme, and its own ways of going wrong. Engineers conflate the two constantly, and it causes a lot of fab rejections.
Gerber File Formats: RS-274X to X2 to X3
Three generations of the Gerber format are floating around. You should care about the differences.
RS-274X (Extended Gerber)
The legacy workhorse. Every fab house on the planet reads it. Every EDA tool exports it. The problem: RS-274X files contain pure geometry with no metadata. A file named board.gbr could be a top copper layer, a bottom solder mask, or a paste stencil. The fab house figures it out from the filename, or from a README you included (you did include one, right?), or by opening each file and squinting.
This works. It’s also fragile.
Gerber X2 (the current standard)
Ucamco (the format’s maintainer) extended RS-274X with structured attribute blocks. These %TF.*% headers embed machine-readable metadata: which layer this file represents, its polarity, what EDA tool generated it, even the creation date.
Here’s what the difference looks like in practice:
; RS-274X — no metadata
%FSLAX36Y36*%
%MOIN*%
; Gerber X2 — embedded attributes
%TF.GenerationSoftware,KiCad,Pcbnew,7.0*%
%TF.FileFunction,Copper,L1,Top*%
%TF.FilePolarity,Positive*%
%FSLAX46Y46*%
%MOIN*%The X2 version tells the fab house exactly what it’s looking at. No guessing. No README required for layer mapping (though you should still include one).
X2 files are backward-compatible. Any tool that reads RS-274X reads X2 just fine; it simply ignores the attribute blocks. There’s zero risk in switching. X2 should be your default output format today.
Gerber X3
Ucamco’s conceptual extension adds component and BOM data to X2. It’s primarily relevant for assembly, not bare-board fab. Worth knowing exists; not worth changing your workflow for yet.
Drill Files Demystified
The Excellon format (also called NC drill) is the de facto standard drill file format. It’s an ASCII file that defines tools (drill bit diameters) and lists X/Y coordinates for each hit. Simple enough in theory. In practice, four things go wrong regularly:
Units mismatch. Your Gerber files say metric. Your drill file says imperial. Or worse, your drill file doesn’t declare units at all, and the fab house defaults to the wrong one. Always verify the header explicitly states
METRICorINCH.Zero suppression. An artifact of older CNC formats. Leading zero suppression, trailing zero suppression, or none. A coordinate of
15.0 mmcan be encoded as15000,150, or01500depending on the setting. Modern best practice: no suppression. Keep all digits. Your EDA tool probably has this option buried in the drill output settings.Plated vs. non-plated separation. Always generate separate files for PTH (plated through-hole) and NPTH (non-plated) holes. A single merged file forces someone at the fab house to guess which holes get plating. They’ll ask. You’ll wait.
Slots. Routed holes (oval or rectangular cutouts) are handled differently across EDA tools. Some export them in the main drill file with G85 routing commands. Some create a separate file. Check your output and verify slots appear where you expect them.
A clean Excellon file looks like this:
M48 ; Header start
METRIC,TZ ; Metric units, trailing zeros kept
T1C0.300 ; Tool 1, 0.3mm diameter
T2C0.800 ; Tool 2, 0.8mm diameter
% ; End header
T1
X015000Y020000 ; Drill hit at (15.0, 20.0) mm
X018500Y020000
T2
X050000Y035000
M30 ; End of fileThe header is where most problems hide. If you see METRIC,TZ, you know the units and zero handling. If the header is empty or ambiguous, fix it before you zip.
IPC-2581: One File to Replace Them All?
IPC-2581 is an open, XML-based standard that encapsulates everything (board geometry, layers, drill data, netlist, BOM, stackup, assembly info) in a single file. Instead of managing 15+ files with format mismatches, you hand over one file and the fab house extracts what it needs.
The current state: Cadence Allegro and Siemens Xpedition support native IPC-2581 export. KiCad support is still in development. On the receiving end, major fabs like TTM and AT&S accept it, but plenty of mid-tier and budget houses don’t yet.
If your fab house accepts IPC-2581 and your EDA tool exports it cleanly, it eliminates most of the file-management headaches described here. If either condition isn’t met, Gerber X2 plus Excellon remains the safe, universal path.
Ask your fab house before assuming. A 2-minute email saves a lot of trouble.
The Pre-Submission Checklist
Run through this before every submission.
- All copper layers present and correctly ordered?
- Solder mask layers for both sides?
- Silkscreen layers (top and/or bottom)?
- Board outline on a dedicated layer, as a closed contour?
- Separate PTH and NPTH drill files?
- Drill files specify units and zero suppression in the header?
- Gerber files use X2 attributes (or a README maps filenames to layers)?
- Fab notes include: layer count, stackup, copper weight, surface finish, board thickness, impedance requirements?
- Files opened and visually inspected in a standalone Gerber viewer (not just the EDA preview)?
- Zip archive has no nested folders or OS junk files (.DS_Store, Thumbs.db)?
Step 9 deserves emphasis. Your EDA’s built-in preview shows you the design data, not the exported file. Export can introduce errors that only show up when you open the actual output in a separate tool. Free options: gerbv (open source), KiCad’s standalone Gerber Viewer, or Ucamco’s Reference Gerber Viewer. Pick one. Use it every time.
┌─────────────────────────────────────────────┐
│ YOUR FAB PACKAGE (.zip) │
│ │
│ ┌──────────────┐ ┌──────────────────────┐ │
│ │ GERBER FILES │ │ DRILL FILES │ │
│ │ (.gbr / .g*) │ │ (.drl / .xln) │ │
│ │ │ │ │ │
│ │ • Copper x N │ │ • PTH drill │ │
│ │ • Mask x 2 │ │ • NPTH drill │ │
│ │ • Silk x 2 │ │ • Drill map (opt.) │ │
│ │ • Outline │ │ │ │
│ │ • Paste x 2 │ └──────────────────────┘ │
│ │ (assembly) │ │
│ └──────────────┘ ┌──────────────────────┐ │
│ │ DOCUMENTATION │ │
│ │ • Fab notes / README │ │
│ │ • Stackup spec │ │
│ │ • IPC-D-356 (opt.) │ │
│ └──────────────────────┘ │
└─────────────────────────────────────────────┘Why Boards Get Rejected (and How to Prevent It)
The five most common rejection reasons, roughly in order of frequency:
Missing or merged drill files. Export PTH and NPTH as separate files. Verify both are in the zip.
Board outline not closed or on the wrong layer. Check for gaps at corners; many EDA tools have a “check outline” function. Export it on a dedicated mechanical layer, not on a copper layer.
Ambiguous layer naming with no README. Use X2 attributes, or include a plain text file mapping every filename to its layer function. Takes 2 minutes.
Solder mask and paste layers swapped. Open each file in your standalone viewer and confirm mask layers show pad openings (not paste deposits). They look similar at a glance.
Units mismatch between Gerber and drill files. Set both to the same unit system in your EDA output settings, then verify the headers of the exported files match. This one’s easy to check and easy to miss.
Building This Into Your Workflow
Every email exchange with the fab house is a minimum 24-hour delay, often more. The goal is zero back-and-forth.
Switch your Gerber output to X2. There’s no downside and it eliminates the most common source of ambiguity. Keep exporting Excellon drill files with explicit unit declarations and no zero suppression. Include a README with your stackup, surface finish, and any controlled impedance requirements.
If you’re working on complex boards (10+ layers, HDI, rigid-flex), ask your fab house about IPC-2581. For everything else, Gerber X2 plus clean Excellon files will get you through without friction.
The “bag of files” model is slowly giving way to single-file standards. But knowing what’s in that bag, why each file exists, and how they can contradict each other means you never lose a week to a missing drill file.
Hubble Network connects Bluetooth devices directly to satellite — no terrestrial infrastructure required. See how it works →