PCB Drafter iconPCB DrafterOpen in your browser

How to make a PCB Gerber file for a board house

Here is how to make a PCB Gerber file set that a board house will accept on the first try: what each file is, which layers a two-layer board needs, the drill files that go with them, and the checks to run before you pay. The format is old and simple, which is why every fab in the world reads it.

How to make a PCB Gerber file: the routed board in PCB Drafter whose copper, mask, silkscreen and outline become the Gerber layers

What a Gerber file is

A Gerber file (format RS-274X) is a text file that draws one layer of the board with flashes (pads) and strokes (traces). The fab photo-plots each layer, so a board is a set of Gerber files, not one. The newer Gerber X2 adds attributes inside each file saying which layer it is and what each pad does, so nothing depends on a file name being understood.

The Gerber layers a two-layer PCB needs

FileLayerWhat the fab does with it
.GTLTop copperEtches the top traces, pads and pour
.GBLBottom copperEtches the bottom traces, pads and pour
.GTS / .GBSSolder mask, top / bottomOpenings in the green coat where pads stay bare
.GTO / .GBOSilkscreen, top / bottomPrints reference designators, values and marks
.GTP / .GBPPaste, top / bottomCuts the solder stencil (surface mount only)
.GKOBoard outlineRoutes the board's shape and cut-outs
-PTH.DRLPlated drillsThrough-hole pads and vias, copper-plated
-NPTH.DRLNon-plated drillsMounting holes, left bare

Drill files are Excellon, not Gerber, but every house wants them in the same zip. A README listing the files, units and layer order saves a CAM engineer a question.

How to make a PCB Gerber file, step by step

  1. Finish the board and pass the DRC. Route every connection (zero airwires), refill the copper pours and fix every design rule finding against the house's rules.
  2. Check the outline and holes. The board outline must be one closed shape, with mounting holes and cut-outs on it. The fab cuts the board along this layer.
  3. Export the Gerber layers. Write one RS-274X file per layer: top and bottom copper, solder mask, silkscreen, paste and the board outline, in millimetres.
  4. Export the drill files. Write Excellon drill files for the plated holes (pads and vias) and the non-plated holes (mounting holes), in the same units and origin.
  5. View the files before you send them. Open the set in a Gerber viewer and look at every layer: pads open in the mask, text on the silkscreen, drills centred on pads.
  6. Zip and upload. Put every file in one zip and upload it to the board house's quote page. Their preview should match what you saw.

The mistakes that get Gerber files rejected

Where to send the files

Budget two-layer houses that take a Gerber zip include JLCPCB, PCBWay, OSH Park (USA), Aisler and Eurocircuits (EU), Seeed Fusion, NextPCB and Elecrow. Compare their minimum trace, gap and drill with your design rules before you upload.

If you order through a referral link, the house may give PCB Drafter's maker a credit or commission. Your price is the same, and some houses add a first-order coupon for you.

New to the whole process? Start with how to design a PCB, or read PCB design vs PCB layout.

Where PCB Drafter fits. PCB Drafter writes the whole fab package in one tap: nine Gerber RS-274X X2 layers, Excellon PTH and NPTH drill files, a schematic PDF and a README, zipped. It is free for boards up to 100 × 100 mm, and the built-in Gerber viewer opens our zip or anyone's so you can check every layer first. In your browser, no account.

Open PCB Drafter in your browser About PCB Drafter Get it on Google Play

Questions

What is a Gerber file in PCB design?

A Gerber file is a plain-text drawing of one layer of a printed circuit board in the RS-274X format. A board house reads one file per layer (copper, solder mask, silkscreen, paste, outline) to make the board.

Which Gerber files does a board house need?

For a two-layer board: top and bottom copper, top and bottom solder mask, top and bottom silkscreen, the board outline, and the drill files. Paste layers are only needed for a stencil.

Are drill files part of the Gerber files?

No. Holes are described in separate Excellon drill files, usually one for plated holes (PTH) and one for non-plated holes (NPTH). Put them in the same zip as the Gerbers.

What is Gerber X2?

Gerber X2 is RS-274X with attributes that say what each file is (top copper, solder mask and so on) and what each pad is for, so the fab's software does not have to guess from file names.

Can I make Gerber files online for free?

Yes. PCB Drafter runs in the browser with no account and exports Gerber X2 and Excellon drill files free for boards up to 100 × 100 mm.

More guides

More guides: Work & create · all Adelyons guides