Summary
How Gerber files are generated from an existing PCB — imaging, vectorization, X2 attributes, drill data, and netlist verification explained.
Gerber file generation from an existing PCB means taking a board that has no design files and rebuilding the manufacturing data from the physical hardware. Every trace, pad, plane, mask opening, and hole gets measured and encoded in the format fabrication equipment actually reads. When the original CAD database is gone — lost, corrupted, or never existed in the first place — this is how you get the board back into production.
The output format is Gerber, the same standard every fab house on the planet accepts. It’s an open format maintained by UCAMCO, which means the files we hand you work anywhere. This guide explains what a Gerber file really is, then walks through how a complete, fabricatable dataset gets built from a bare board.
What a Gerber File Actually Is
A Gerber file is a 2D vector image — a list of drawing commands that describes one layer of the board. The modern version, RS-274X, embeds its own aperture definitions, so the file is self-contained. The newer Gerber X2 adds attributes that label each file’s function (top copper, bottom mask, board outline) so the fab’s CAM software knows exactly what it’s looking at without relying on filenames.
The command set is small. Knowing it helps when a file misbehaves:
- Coordinate format and units —
FSLAX36Y36sets the number format;MOMMsets millimeters. - Aperture definition —
%ADD10C,0.25*%defines a circular “brush” of 0.25 mm. Apertures are the brushes: circles, rectangles, obrounds. - Draw / move / flash —
D01draws a line,D02moves without drawing,D03stamps a pad. - Regions —
G36…G37encloses a filled copper pour as an outline instead of thousands of tiny lines. - Polarity —
LPD(dark/add) andLPC(clear/subtract) control whether features add or remove copper.
The full grammar is in the freely downloadable Gerber File Format Specification. The newer Gerber X3 adds even more manufacturing metadata.
The File Set a Board Needs
One Gerber file describes one layer. A fabricatable board needs a coordinated set, plus a drill file in a separate format:
| File (typical suffix) | Content | Gerber X2 label |
| Top copper (.GTL) | Top-layer traces and pads | Copper,L1,Top |
| Inner copper (.G2, .G3…) | Internal signal or plane layers | Copper,L2,Inr |
| Bottom copper (.GBL) | Bottom-layer traces and pads | Copper,L4,Bot |
| Top solder mask (.GTS) | Mask openings on top | Soldermask,Top |
| Bottom solder mask (.GBS) | Mask openings on bottom | Soldermask,Bot |
| Top silkscreen (.GTO) | Legend / reference designators | Legend,Top |
| Board profile (.GKO) | Outline, slots, cutouts | Profile |
| Drill file (Excellon) | Hole positions, sizes, plating | (separate format) |
The drill data is not Gerber. Holes go in an Excellon NC file — a tool table of diameters followed by X/Y coordinates, with plated and non-plated holes separated. A complete handoff always includes both.
How the Data Gets Built From a Board
1. Image each copper layer
Outer layers are scanned directly after the solder mask is removed or seen through. Inner layers are exposed by careful grinding, or recovered by X-ray if the board can’t be sacrificed. Each scan is registered to the drilled-hole pattern — not the board edge, which can be irregular. In the CAM tool, the raster image gets traced into vectors: traces as drawn lines, pads as flashes, copper pours as filled regions. Trace widths and clearances must be preserved exactly. A 5-mil trace rebuilt as 7 mil changes both impedance and current capacity.
2. Rebuild apertures and regions
As features get traced, the tool builds an aperture list — the set of circle, rectangle, and obround sizes actually used — and writes them as %ADD… definitions. Copper planes become regions, not line drawings. This keeps the file compact and the geometry clean.
3. Add X2 attributes
Instead of relying on filenames like “.GTL”, each file gets tagged with its function: %TF.FileFunction,Copper,L1,Top*%. This makes the dataset self-describing. A fab can’t misread which layer is which, even if a file gets renamed.
4. Rebuild the drill file
Every hole is measured for position and diameter and written to the Excellon file with a tool table. Plated through-holes, non-plated holes, and slots are separated. The drill file is checked against the copper: every via must land on a pad with enough annular ring.
5. Verify before release
Two checks, both mandatory. First, the connectivity implied by the Gerbers is compared against the flying-probe netlist measured from the original board — this proves the copper is electrically correct. Second, a CAM viewer renders the full stack and runs DFM checks: trace/space, annular ring, mask slivers, drill clearance. Only a dataset that passes both goes out the door.
Where Jobs Go Wrong
We’ve taken over Gerber generation jobs from customers who tried it themselves or used a cheaper service. The failure modes repeat:
- Missing aperture table. An RS-274X file without embedded apertures renders wrong or fails to load. Amateur tools sometimes skip this.
- Layer misregistration. If inner layers get aligned to the board edge instead of the holes, pads drift off vias. This shows up as opens or shorts on the fabricated panel.
- Planes drawn as lines. Rebuilding a copper pour as thousands of thin traces bloats the file and can introduce gaps. Planes belong in regions.
- Drill/copper mismatch. A via pad that doesn’t match its drill size, or a missing annular ring, is a fabrication defect that only appears at the shop.
- No netlist check. Gerbers that “look right” in a viewer can still have a missing trace or a phantom short. The measured netlist is the only objective proof.
A Gerber dataset is a contract with the fabrication equipment. Every aperture, region, and attribute either states the geometry precisely or leaves room for the fab to guess — and a fab should never have to guess.
A Job We Fixed Last Year
A customer sent us a set of Gerbers they’d paid another shop to generate from a 6-layer medical controller. The boards came back from the fab and failed ICT across the board — shorts everywhere. We loaded the files: the inner layers had been registered to the board edge, and the edge wasn’t straight. Every inner-layer pad was shifted by a fraction of a millimeter, just enough to short against adjacent vias. The shop that made the files had never run a netlist comparison, so they never caught it.
We re-imaged the board properly — hole-pattern registration, netlist extraction from the surviving sample, full X2 output with file-function attributes. The new dataset fabricated clean the first time. The customer’s lesson, and ours for telling it: cheap Gerber generation is expensive. The verification step isn’t overhead; it’s the deliverable.
Related Reading
- PCB Clone Services (Pillar)
- How to Clone a PCB Board
- The Cloning Workflow
- Multilayer Reverse Engineering
- Netlist Extraction
Frequently Asked Questions
Can Gerber files be made from a finished board?
Yes. By imaging each copper layer, vectorizing the geometry, rebuilding the drill data, and verifying against a measured netlist, a complete dataset can be generated from a board that has no design files. That’s the core of a PCB clone.
What’s the difference between RS-274X and Gerber X2?
RS-274X is the long-standing format with an embedded aperture table. Gerber X2 adds attributes — file function, net, component — so the data is self-describing. X2 files open in any RS-274X tool; older tools just ignore the attributes.
Do I need a separate drill file?
Yes. Gerber describes image layers; holes go in Excellon format. A complete handoff always includes the drill file, with plated and non-plated holes distinguished.
How do I know the generated Gerbers are correct?
Render the full stack in a CAM viewer and run DFM checks — but the real proof is comparing the connectivity from the Gerbers against the flying-probe netlist measured on the original board.
Will any fab accept these files?
Any fab that accepts standard Gerber RS-274X/X2 and Excellon drill will accept a correctly generated dataset. That’s the point of an open standard — the files are portable and inspectable anywhere.
Need Gerbers From a Board That Has None?
Send us the board — we’ll image it, verify the dataset against the measured netlist, and hand you files any fab can run. See our PCB clone service or contact us to start.
References
- UCAMCO — The Gerber format: https://www.ucamco.com/en/gerber
- UCAMCO — Gerber File Format Specification (PDF): https://www.ucamco.com/files/downloads/Gerber/The_Gerber_File_Format_specification.pdf
- Excellon format reference: https://en.wikipedia.org/wiki/Excellon_format
- IPC — standards for fabrication: https://www.ipc.org/



