makeIRLEngineering notes

Manufacturing

What Is a Gerber File? PCB Manufacturing Data Explained

Learn what Gerber PCB files contain, why drill and assembly data are separate, and how to export and inspect a correct fabrication package from KiCad.

Published Updated

A Gerber file is layer artwork, not the whole PCB project

A Gerber file describes the shapes a board fabricator must reproduce on one physical layer: copper, solder mask, silkscreen, or another plotted layer. It is a vector manufacturing format built from coordinates, drawing operations, apertures, regions, and polarity. It is not a screenshot, and it is not normally one monolithic “PCB file.”

For a two-layer board, the fabrication archive commonly contains separate plots for:

  • front and back copper;
  • front and back solder mask;
  • front and back silkscreen, when used;
  • the board profile from Edge.Cuts;
  • plated and non-plated drill data;
  • optionally, a Gerber job file with stackup and other metadata.

Paste layers describe stencil openings for surface-mount assembly. They are usually relevant to a stencil or PCBA order, not to making a bare board. Fabrication drawings and assembly drawings can provide useful human context, but they do not replace the plotted production data.

This distinction matters because the phrase “send the Gerbers” is conversational shorthand for “send the fabrication package.” Drill files are often Excellon, not Gerber. A centroid file and BOM belong to assembly. The pick-and-place file tells a placement machine where components go; no copper Gerber can supply that information reliably.

What is actually inside the format

Modern Extended Gerber embeds the aperture definitions required to interpret a layer. An aperture can represent a round pad, a rectangular feature, a line width, or a more complex macro. Commands move to coordinates, flash shapes, draw strokes, and create filled regions. Clear and dark polarity operations build openings and solid areas.

Gerber X2 adds attributes that identify file functions and features—for example, whether a file is top copper or bottom solder mask. Those attributes reduce dependence on filename conventions. X2 can also carry pad and net-related metadata, but it remains layer-oriented manufacturing data; it does not become an editable schematic or authoritative netlist.

The Gerber Job file (.gbrjob) complements the layer files with information about the file set, board stackup, finish, and materials. Support varies by fabricator, so the order form and a clear readme still matter for unusual requirements. For an ordinary pooled prototype, standard layer files plus drills are deliberately simple and portable.

Old “Standard Gerber,” also called RS-274-D, depended on an external aperture list and is obsolete for normal PCB exchange. If a tutorial tells you to send a wheel or aperture table separately, it is describing a legacy workflow. KiCad exports Extended Gerber and X2-capable output.

What Gerbers cannot tell the fabricator

Gerber layers show the geometry you plotted. They do not inherently communicate every design decision. Unless supplied through supported metadata or the order form, the shop still needs choices such as:

  • layer count, finished thickness, copper weight, material, and surface finish;
  • controlled-impedance requirements and the agreed stackup;
  • solder-mask and silkscreen colors;
  • panelization, edge plating, countersinks, or special tolerances;
  • which drill data is plated and which is non-plated.

They also do not prove that the electrical design is correct. A beautiful Gerber can faithfully manufacture a shorted net, a reversed connector, or a missing pull-up. Run ERC and DRC before plotting, following a real pre-order DFM checklist.

Gerber is effectively a flattened release artifact. Editing one in isolation breaks traceability to the KiCad source and can desynchronize copper, mask, and drill data. If a fab requests a design change, make it in the source board, rerun checks, and regenerate the complete package.

Export a controlled set from KiCad

In PCB Editor, use File → Fabrication Outputs → Gerbers (.gbr). For a normal two-layer board, select F.Cu, B.Cu, F.Mask, B.Mask, F.Silkscreen, B.Silkscreen, and Edge.Cuts. Enable Gerber job file generation when your recipient accepts it. Avoid plotting drawing-sheet borders onto production layers.

Then choose Generate Drill Files from the plot dialog, or use File → Fabrication Outputs → Drill Files (.drl). Keep one coordinate origin for Gerbers, drills, paste, and position data. The safest choice is usually KiCad’s absolute origin unless your assembly vendor specifies a placement origin.

KiCad 9 can generate a repeatable package from the command line:

rm -rf build/fab
mkdir -p build/fab/gerbers build/fab/drill

kicad-cli pcb export gerbers \
  --layers F.Cu,B.Cu,F.Mask,B.Mask,F.Silkscreen,B.Silkscreen,Edge.Cuts \
  -o build/fab/gerbers/ \
  board.kicad_pcb

kicad-cli pcb export drill \
  --format excellon \
  --excellon-units mm \
  --generate-map \
  --map-format pdf \
  -o build/fab/drill/ \
  board.kicad_pcb

Use gerbers in the plural. In KiCad 9, that command writes one file per selected layer, which is the usual fabrication output. The singular gerber command combines layers into one file and is deprecated.

For a JLCPCB-specific walkthrough, including expected layer names, see exporting Gerbers from KiCad for JLCPCB. The same principle applies to other fabs: follow that recipient’s current file and capability requirements, not a random archive copied from an older project.

Inspect the release as a manufacturer sees it

Never approve an archive merely because the export command succeeded. Open KiCad GerbView and load every plotted layer plus the drill files. Check the following independently:

  1. Edge.Cuts is one closed outline, with intentional internal cutouts visible.
  2. Copper layers have the expected pads, tracks, zones, and no stale text or test geometry.
  3. Solder-mask openings expose pads without unexpectedly uncovering traces or deleting mask dams.
  4. Silkscreen is not clipped into meaningless fragments and does not cover bare pads.
  5. Drills and annular rings align with copper, and NPTH/PTH separation is correct.
  6. Mirroring and layer sides make sense when viewed from the top and bottom.

Zip only the release outputs, not the entire KiCad project, old plot directories, PDFs with conflicting outlines, or two revisions of the same layer. Give the archive a revision-bearing name such as sensor-r3-fab.zip, record the source commit that generated it, and upload that exact archive. Then inspect the fab’s rendered preview. That final comparison catches misclassified layers and origin mistakes before they become fiberglass.