Common Gerber file errors and how to fix them before ordering
Why fabs reject Gerber files
A PCB order is only as good as the files behind it. The fab does not open your KiCad or Altium project. It loads the Gerber and drill files into its CAM system, checks them, and builds the board from what it finds there. JLCPCB states this plainly in its ordering guide: PDFs, DXF files, spreadsheets and notes inside the ZIP are disregarded, and the board is made from the Gerber files only. If a project file and Gerbers are both uploaded, the Gerbers win.
When something essential is missing, the reaction can be abrupt. The same JLCPCB guide says that orders with missing layers, "such as no board outline and drilling", are cancelled directly.
The errors below are the ones the fabs themselves describe in their help pages and design guidelines. Each comes with the fix and a way to catch it before you upload.
The quickest check
Open the exact ZIP you are going to upload in a viewer that did not create it, such as the PCB Tools Gerber viewer.
1. Missing or broken board outline
This is the classic one. PCBWay's help centre lists the board outline first among the required files, because it "defines the shape and size" of the PCB. The other required items are the copper layers, solder mask, silkscreen and the NC drill file.
The outline can be missing in three ways:
- Not exported at all. The Edge.Cuts or mechanical layer was not ticked in the plot dialog.
- Exported, but not recognised. JLCPCB's naming guide describes the error as "either the board outline was not on the Dimension layer, or the outline was placed on the wrong gerber layer". Its known-good extensions for the outline are
.GKOor.GM1. - Exported, but not closed. A small gap between two segments leaves the CAM system unable to decide where the board ends.
Fix: draw the outline on the layer your CAD tool uses for the board edge, make sure every corner joins exactly, and include that layer in the export. If the fab still does not pick it up, rename the file to the extension its guide lists. Our Gerber file extensions guide maps the common extensions to their layers.
2. No drill file, or only half of it
Drill data is written separately from the Gerbers, usually in Excellon format, and is easy to forget. JLCPCB's naming guide lists a "Could not find drill file" error and notes that it shows up in particular on 4-layer boards when blind or buried vias are enabled in the export. The same page recommends including a drill map or drawing so the fab can confirm hole positions and attributes.
Many CAD tools write plated (PTH) and non-plated (NPTH) holes to two separate files. Upload only one and you lose either every via and component hole, or every mounting hole.
PCBWay's review shows this as "There's no drill file inside". If the board really has no holes, choose no drills in the online quote; otherwise the files must be resubmitted.
Fix: generate the drill files into the same folder as the Gerbers, and check the ZIP for both PTH and NPTH files when your tool splits them. In a viewer, every through-hole pad should have a drill hit in its centre, and every mounting hole should appear. For KiCad users, our KiCad 10 Gerber export guide goes through the drill dialog option by option.
3. Layers that do not line up
If the drill holes sit a few millimetres off the pads, or one layer is shifted relative to the others, the files were exported with different origins, units or precision. Eurocircuits' "10 rules for better data" addresses this directly:
- use the same offset for all Gerber layers and the Excellon data, and preferably no offset at all;
- output Gerber and Excellon in the same units your CAD system uses internally, to avoid conversion and rounding errors;
- use the same resolution for Gerber and Excellon. Eurocircuits recommends 6 decimals for imperial units and 5 for metric;
- submit all data at a scale of 1:1.
Fix: export Gerbers and drill files in one session with the same origin setting. In KiCad that means the "use drill/place file origin" choice in the plot dialog must match the origin in the drill dialog. Then load everything together in a viewer and zoom in on a few pads.
4. Mirrored layers
Eurocircuits' rule 6 is short: do not mirror or reflect any data layer. All layers are viewed from the top. Text on top layers reads normally, and text on bottom layers appears mirrored when seen from above. Their data preparation team lists "mixed readable and mirrored text" among the problems they check for.
Fix: turn off any mirror option in the plot and drill dialogs. Eurocircuits also suggests putting a small piece of text on each copper layer, such as a board ID. If the text on the bottom copper reads correctly when you view the stack from above, that layer has been mirrored by mistake.
5. Obsolete Gerber and missing apertures
Gerber files describe shapes with apertures (D codes). In the old RS-274-D format, often called Standard Gerber, aperture definitions were not standardized, which Ucamco names as its main problem. Ucamco, which maintains the Gerber specification, revoked Standard Gerber in 2014 and states that such files do not conform to the specification and are no longer valid. It puts their use at fewer than 2% of jobs.
At the fab, this shows up as an order that fails review with a message like PCBWay's "Without D-code": the file does not define the shape and size of pads, tracks and holes, so the machines have nothing to work from.
A related fault is a zero-size aperture or drill tool. Eurocircuits' rules ask for no apertures of 0.00 mm or inches in the Gerbers and no zero-size tools in the Excellon file, and their CAM analysis flags "undefined apertures or drill-tools".
Fix: export Extended Gerber (RS-274X), or X2 if your fab accepts it. Remove zero-width lines from copper and mask layers before plotting.
6. The ZIP holds more than one design
PCBWay expects one set of Gerbers per order. If the upload contains several, the review fails and you are asked to choose: turn them into a panel (accepting that X-out boards may be included), split them into separate orders shipped together, or tell the fab which set is the right one.
It usually happens by accident: an old revision in a subfolder, or a whole project folder zipped at once.
Fix: zip only the output folder for the revision you are ordering. Open the ZIP and read the file list before uploading. If you really want several designs on one panel, arrange that with the fab first.
7. Layers that do not match the order form
The order form and the files have to agree. PCBWay's guidance for incomplete file sets is to select "none" in the online options when a board really has no solder mask, silkscreen or drilling, and to state which copper layers are meant to be empty. Otherwise a missing layer is read as an error and the order is held.
Two other messages from PCBWay's file issue list belong in this group. "Break lines exist in your file" means the CAM engineer has found copper that looks cut and asks whether the break is intentional. "Silkscreen on every layer" means silkscreen data turned up on all the layers, which PCBWay attributes to a mistake when the files were generated. In KiCad, check that the "Plot on All Layers" list is empty before plotting.
Fix: fill in the order form after you have checked the files, and make sure the layer count, mask and silkscreen options match what is in the ZIP. If a strange feature is intentional (a deliberate copper gap, a board without mask), say so in the order notes.
8. Copper, mask and drill that disagree
Even when every file is present and aligned, the layers can disagree with each other. Eurocircuits lists three cross-checks in its description of data preparation:
- copper against drill: are there any missing copper pads?
- drill against copper: are there any missing drill holes?
- solder mask against copper: are there any missing solder mask openings?
Fix: run the design rule check in your CAD tool before exporting, then repeat the three checks visually. Toggle the mask layer over the copper and look for pads that stay covered.
A short routine before every upload
- Export Gerbers and drill files in one go, into an empty folder.
- Zip only that folder.
- Open the ZIP in the PCB Tools viewer and confirm the layer list: copper, mask, silkscreen, outline, drill.
- Stack all layers and check alignment, outline closure and mirrored text.
- Match the order form to what you see.
The full list is in our guide to checking Gerber files before ordering.
Sources
- JLCPCB, Step-by-step ordering guide
- JLCPCB, Suggested naming patterns
- PCBWay, File issues: Gerber files are not completed
- PCBWay, File issues: Without D-code
- PCBWay, File issues: Several gerber files in your order
- PCBWay, File issues: No drills in your file
- PCBWay, File issues: Silkscreen on every layer
- PCBWay, File issues: Break lines exist in your file
- Eurocircuits, 10 rules for better data
- Eurocircuits, Eurocircuits data preparation: Analysis
- Ucamco, Standard Gerber
Check your Gerbers before you order
Load the ZIP or RAR your EDA tool exported and inspect every layer, drill and outline in the browser. Free, no account.
Open the Gerber viewer