Electronic Project Engineer's Best Partner!
engineer

Gerber File Format Explained: A Complete Guide to PCB Fabrication Data

24 0 Jul 06.2026, 17:41:18

If you design printed circuit boards, the Gerber file is the language you use to talk to your fabricator. Get it right, and your board comes back exactly as designed. Get it wrong, and you're looking at CAM holds, re-spins, or a board that simply doesn't work. This guide breaks down what a Gerber file actually contains, how the format evolved, how it compares to alternatives like ODB++ and IPC-2581, and the specific mistakes that most often delay a fabrication run.

What Is a Gerber File?

A Gerber file is a 2D vector description of one layer of a PCB design — not the whole board at once. A typical multilayer project therefore ships as a set of Gerber files: one for each copper layer, one for each solder mask, one for silkscreen, one for the board outline, plus separate drill files for plated and non-plated holes. Together, this file set is what a fabrication house loads into its CAM (computer-aided manufacturing) system to prepare tooling, phototools, and machine instructions for every stage of production.

The format is intentionally text-based (ASCII), which means a Gerber file can be opened and inspected in any plain text editor. Inside, you'll find a short header defining units and coordinate format, followed by a stream of drawing commands. Each command tells the plotting or imaging equipment to either draw a line, move without drawing, or flash a shape at a given coordinate — the same logic used since the format's earliest photoplotter days, just applied to modern laser and inkjet imaging systems today.

Gerber file of PCB

From RS-274D to Gerber X2: A Brief History

The format takes its name from Joseph Gerber, whose company pioneered the vector photoplotter in the 1960s and published the first Gerber format specification in 1980 as a subset of the EIA RS-274-D standard. That original version — now called Standard Gerber or RS-274D — only recorded coordinates and aperture numbers. The actual shapes those numbers referred to lived in a separate, informally-agreed "aperture" or "wheel" file, which made automated data exchange between designer and fabricator unreliable.

RS-274X (Extended Gerber), released in 1998, solved that problem by embedding aperture definitions directly inside the Gerber file itself, so no external file is needed to interpret it. This made each layer file self-contained and is the reason RS-274X remains the format nearly every fabricator, including PCBgogo, expects today. More recently, Gerber X2 extended RS-274X further by adding attributes that label each file with its function — for example, marking a file as top copper or bottom solder mask — which cuts down on the layer-mix-ups that happen when files are misnamed.

StandardAperture DataStatus Today
RS-274D (Standard Gerber)External wheel/aperture file requiredObsolete — avoid for new designs
RS-274X (Extended Gerber)Embedded in the fileCurrent industry standard
Gerber X2Embedded, plus function attributesRecommended where supported
GerberJobN/A — job-level metadata fileOptional companion file for stackup/finish data

How a Gerber File Is Structured

Every RS-274X file follows the same basic shape: a header block that sets the measurement units (inches or millimeters) and coordinate format, followed by data blocks that generate an ordered stream of graphic objects. Three commands do almost all of the work:

  • D01 (Draw) — moves to a coordinate with the "pen" down, creating a track, trace, or outline segment.

  • D02 (Move) — repositions to a coordinate without drawing, used to jump between separate shapes.

  • D03 (Flash) — stamps a predefined aperture shape at a coordinate, used for pads, vias, and other filled features.

Because apertures behave like fonts — reusable shapes referenced by a code rather than redrawn from scratch — a Gerber file can describe complex pad geometry, including BGA and QFN land patterns, without repeating shape data for every instance. This keeps files compact even for dense, high-pin-count designs.

The Standard Gerber File Set for a PCB Project

A single-layer board might need only three or four files, but a multilayer design requires a distinct file per copper layer plus mask, silkscreen, and drill data. Consistent, unambiguous naming matters just as much as the data itself — a mislabeled inner layer is one of the most common causes of a CAM hold.

Layer / DataTypical File ContentCommon Extension
Top / Bottom CopperTraces, pads, copper pours.GTL / .GBL
Inner Copper LayersInternal routing and planes.G1, .G2 ... or .GP1, .GP2
Top / Bottom Solder MaskMask openings over copper.GTS / .GBS
Top / Bottom SilkscreenLegend, reference designators.GTO / .GBO
Board Outline / KeepoutMechanical profile of the board.GKO / .GM1
Plated Drill Data (PTH)Vias and plated component holes.TXT / .DRL (Excellon)
Non-Plated Drill Data (NPTH)Mounting holes, unplated holes.TXT / .DRL (Excellon)
Netlist (optional)Electrical connectivity for verificationIPC-D-356A

Gerber vs. ODB++ vs. IPC-2581: When to Use Which

Gerber isn't the only fabrication data format, and it's worth knowing what the alternatives offer even though Gerber (RS-274X) remains the safest default for most projects.

FormatFile StructureBest ForAdoption
Gerber (RS-274X / X2)One file per layer, plus separate drill filesStandard multilayer boards; universal fabricator supportNear-universal
ODB++Single job archive containing all layers, netlist, and stackupComplex or high-density designs where a single consolidated dataset reduces mismatch riskStrong among larger EDA tools and CMs
IPC-2581Single open XML-based file with layers, netlist, and BOMTeams wanting a vendor-neutral, fully automated data exchangeGrowing, less universal than Gerber

In practice, most fabrication shops build their workflow around Gerber because it's supported by every major EDA tool and requires no proprietary import step. Unless your contract manufacturer specifically asks for ODB++ or IPC-2581, a clean RS-274X Gerber set with Excellon drill files is the safest and fastest path to production.

Generating Gerber Files from Popular EDA Tools

The export step looks slightly different in every tool, but the underlying checks are the same: confirm RS-274X format, match units across all layers and drill files, and double-check that the board outline layer is included.

ToolExport PathKey Setting / Note
Altium DesignerFile > Fabrication Outputs > Gerber FilesEnable "Embedded apertures (RS-274-X)"
KiCadFile > Plot, then Generate Drill FileSelect all required layers before plotting
EAGLECAM Processor with Gerber job fileConfirm correct layer-to-job mapping

Whichever tool you use, run your design rule check (DRC) before export, not after — catching a clearance or annular ring violation in the CAD tool is far faster than catching it after your fabricator flags the Gerber set.

Comon Gerber File Errors That Delay Fabrication

Most fabrication delays trace back to a small, repeatable set of Gerber issues. Reviewing your file set against this list before submission catches the majority of them.

IssueTypical CauseHow to Avoid It
Missing board outlineOutline/keepout layer not selected during exportAlways include a dedicated outline or mechanical layer in the export
Mixed units across filesSome layers plotted in mm, others in inchesSet and verify units once, then confirm every layer and the drill file match
Unreferenced aperturesAperture used in the file but not defined in the headerUse RS-274X, which embeds definitions, instead of legacy RS-274D
Missing drill tool tableExcellon file exported without a header tool listConfirm the drill file lists every tool size before export
PTH and NPTH mixed togetherSingle drill file used for both hole typesExport plated and non-plated holes as separate files
Incorrect layer count vs. stackupInner layer files missing or duplicatedCross-check the number of Gerber layers against your intended stackup

PCB Layout Considerations That Keep Gerber Output Clean

  • Set your unit and coordinate format once at the start of the project and don't change it mid-design.

  • Name layers clearly and consistently (TopCopper, BottomMask, TopSilk, BoardOutline) so nothing gets mapped incorrectly during CAM import.

  • Keep the board outline on its own dedicated layer, separate from silkscreen or assembly notes.

  • For HDI designs, confirm thermal vias and microvias are captured correctly in both the copper and drill layers before export.

  • Include a short readme or fabrication drawing noting stackup, copper weight, and surface finish alongside your Gerber set — it resolves ambiguity a Gerber file alone can't communicate.

PCB Layout

How PCBgogo Works With Your Gerber Files

PCBgogo has built its fabrication and assembly workflow around exactly the kind of Gerber data covered in this guide. A few specifics worth knowing if you're preparing a submission:

  • Every submitted Gerber and drill file set goes through a DFM (Design for Manufacturing) check to flag clearance, annular ring, and layer-alignment issues before production starts.

  • HDI fabrication capability supports designs with microvias and finer trace/space requirements, provided the Gerber and drill data clearly represent the stackup.

  • X-ray inspection is available for verifying alignment on BGA, QFN, and other hidden-lead packages during assembly.

  • Precision SMT assembly is offered alongside bare-board fabrication, so the same Gerber and BOM submission can carry through to a populated board.

  • PCBgogo is ISO 9001:2015 and UL certified, and orders can start from as few as 5 boards — useful for validating a new Gerber export before committing to a larger run.

Before uploading your files, open your Gerber set in a viewer ( Gerbv, KiCad's Gerber viewer, or PCBgogo online viewer) to confirm layer alignment and drill placement. It takes a few minutes and catches most of the issues in the error table above before they reach a CAM engineer.

Frequently Asked Questions

What's the difference between a Gerber file and an Excellon drill file?

A Gerber file describes an image layer — copper, mask, or silkscreen — using draw and flash commands. An Excellon file is a separate, coordinate-based format specifically for drill and rout data, listing hole positions and tool sizes rather than image geometry. A complete fabrication package needs both.

Is RS-274D (Standard Gerber) still accepted by manufacturers?

Most fabricators, including PCBgogo, expect RS-274X or newer because it embeds aperture definitions and avoids the ambiguity of separate wheel files. RS-274D is considered obsolete and should be avoided for new designs whenever your EDA tool supports RS-274X export.

Can I open and check a Gerber file without PCB design software?

Yes. Because Gerber is plain ASCII text, you can open a file in any text editor to read the raw commands, though a dedicated Gerber viewer is far more practical for checking layer alignment, drill placement, and overall board geometry visually before submission.

What is Gerber X2 and do I need it?

Gerber X2 adds attributes that label each file with its function — such as identifying a layer as top copper or bottom solder mask — directly inside the file. It isn't mandatory, but it reduces the chance of layer mix-ups during CAM import and is worth enabling if your EDA tool supports it.

How many Gerber files does a typical multilayer PCB require?

A basic 2-layer board typically needs six to eight files: top and bottom copper, top and bottom solder mask, top and bottom silkscreen, board outline, and drill data. Each additional inner copper layer in a multilayer stackup adds one more Gerber file to the set.

Share the Project