Gerber File Explained: Layer Files for PCB Fabrication
Gerber files are the industry-standard format for communicating PCB design data to fabrication houses. When you order a PCB from JLCPCB, PCBWay, or any Indian manufacturer, you submit a ZIP archive of Gerber files that precisely defines every layer of your board — copper traces, solder mask openings, silkscreen labels, and board outline. Understanding what each file does prevents costly ordering mistakes.
This guide explains every Gerber file layer, how to export them correctly from KiCad and EasyEDA, and what to verify before placing your order.
What Are Gerber Files?
Gerber format (RS-274X and the newer Gerber X2) is a 2D vector graphics format that describes each layer of a PCB as a series of apertures (shapes) and draw operations. Each Gerber file represents one layer. A complete PCB Gerber package includes files for every copper layer, solder mask, silkscreen, and the board outline.
The format is named after Gerber Scientific Instruments, who developed it in the 1960s for photoplotter machines. Modern fabs use Gerber files to drive laser imaging equipment, CNC drill machines, and AOI (Automated Optical Inspection) systems.
RS-274X vs Gerber X2
RS-274X (Extended Gerber): The traditional standard, universally supported. Does not include component placement data or layer function metadata.
Gerber X2: Modern extension that embeds layer function metadata directly in the file header. Allows fabrication software to automatically identify which file is which copper layer, solder mask, etc. Supported by KiCad 6+ and modern fabs including JLCPCB. When available, prefer X2.
Gerber File Types Explained
Copper Layers
Copper layers define where copper exists on the PCB. For a 2-layer board, there are two copper Gerbers. A 4-layer board has four. Each file shows:
- Trace routes
- Pad landing areas
- Copper fills and pours
- Via annular rings
| KiCad Layer | Gerber Extension | Description |
|---|---|---|
| F.Cu (Front Copper) | GTL or .F_Cu.gbr | Top copper layer |
| B.Cu (Back Copper) | GBL or .B_Cu.gbr | Bottom copper layer |
| In1.Cu | G2L or .In1_Cu.gbr | Inner layer 1 (4+ layer boards) |
| In2.Cu | G3L or .In2_Cu.gbr | Inner layer 2 (4+ layer boards) |
Solder Mask Layers
Solder mask is the colored coating (usually green, but also red, blue, black, yellow, or white) that covers the PCB surface except where pads need to be exposed for soldering. The solder mask Gerber is a negative image: where there is data = where mask is removed (pad openings).
| KiCad Layer | Extension | Description |
|---|---|---|
| F.Mask (Front Mask) | GTS or .F_Mask.gbr | Top solder mask openings |
| B.Mask (Back Mask) | GBS or .B_Mask.gbr | Bottom solder mask openings |
Common mistake: Solder mask is a negative layer. If you see a large blank area in the Gerber viewer where your board outline is, that usually means the mask is defined correctly (it shows the openings, not the mask itself). A board with no pads would show an empty mask Gerber.
Silkscreen Layers
Silkscreen Gerbers define the printed text and symbols on the PCB surface.
| KiCad Layer | Extension | Description |
|---|---|---|
| F.SilkS (Front Silk) | GTO or .F_SilkS.gbr | Top silkscreen (component side) |
| B.SilkS (Back Silk) | GBO or .B_SilkS.gbr | Bottom silkscreen |
Paste Layers (Optional)
Solder paste Gerbers define the stencil openings used for SMT assembly. They are required when ordering a stainless steel stencil from the fab. For boards assembled manually or if you are ordering bare PCBs only, paste layers are optional (but include them anyway for completeness).
| KiCad Layer | Extension | Description |
|---|---|---|
| F.Paste | GTP or .F_Paste.gbr | Top paste/stencil openings |
| B.Paste | GBP or .B_Paste.gbr | Bottom paste/stencil openings |
Board Outline (Edge Cuts)
The board outline Gerber defines the PCB shape. This is used by the CNC router that cuts the board to shape.
- KiCad: Edge.Cuts layer, exported as GKO or .Edge_Cuts.gbr
- Important: The outline must be a closed shape with no gaps. A gap in the outline causes the router to cut incorrectly, potentially ruining your board.
- Include only the board outline in this file — no copper, no silkscreen
- For boards with slots or cutouts, include them in this file
Drill Files (Excellon Format)
Drill files (also called NC drill or Excellon files) are NOT Gerber files — they use a different format (Excellon 2). However, they are always included in the “Gerber package.” Drill files tell the CNC drill machine where to drill holes and at what diameter.
Types of Drill Files
- PTH (Plated Through-Hole): Holes with copper plating inside — used for through-hole components and vias. These create electrical connections between layers.
- NPTH (Non-Plated Through-Hole): Holes without copper plating — used for mounting holes and mechanical features.
KiCad Drill Export Settings
- Format: Excellon (standard)
- Units: Millimeters (match your board units)
- Zeros format: Suppress leading zeros (JLCPCB/PCBWay preferred)
- Generate separate files for PTH and NPTH: Yes
- Plating: Select “separate files”
Layer Naming Conventions
Different EDA tools and fabs use different naming conventions for Gerber files. This causes confusion when fabs try to identify which file is which layer. Here is a comparison:
| Layer | Altium | KiCad (classic) | KiCad X2 | Eagle |
|---|---|---|---|---|
| Top Copper | .GTL | .GTL | .F_Cu.gbr | .cmp |
| Bottom Copper | .GBL | .GBL | .B_Cu.gbr | .sol |
| Top Mask | .GTS | .GTS | .F_Mask.gbr | .stc |
| Bottom Mask | .GBS | .GBS | .B_Mask.gbr | .sts |
| Top Silk | .GTO | .GTO | .F_SilkS.gbr | .plc |
| Board Outline | .GKO | .GKO | .Edge_Cuts.gbr | .dim |
| Drill | .DRL | .drl | .drl | .drl |
When submitting to Indian fab houses: Many domestic manufacturers prefer the classic Altium naming convention (.GTL, .GBL, .GTS, etc.). When exporting from KiCad, you can configure the file extensions in the Gerber export dialog to match the expected naming.
Exporting Gerbers from KiCad
In KiCad 7/8 (PCB Editor):
- Go to File > Fabrication Outputs > Gerbers (.gbr)
- Select output directory (create a dedicated “gerbers” folder)
- Check all required layers: F.Cu, B.Cu, F.Mask, B.Mask, F.SilkS, B.SilkS, F.Paste, B.Paste, Edge.Cuts
- For multi-layer boards: add In1.Cu, In2.Cu, etc.
- Settings: Use Protel filename extensions = ON (gives .GTL, .GBL naming); Gerber X2 format = ON if fab supports it
- Click “Plot” to generate Gerber files
- Then click “Generate Drill Files” in the same dialog
- Drill settings: Excellon format, mm units, separate PTH/NPTH files
- ZIP the output folder and upload to fab
KiCad Gerber Export Checklist:
- F.Cu.gbr (or .GTL)
- B.Cu.gbr (or .GBL)
- F.Mask.gbr (or .GTS)
- B.Mask.gbr (or .GBS)
- F.SilkS.gbr (or .GTO)
- B.SilkS.gbr (or .GBO) [optional]
- F.Paste.gbr (or .GTP) [for stencil]
- Edge.Cuts.gbr (or .GKO)
- [board]-PTH.drl
- [board]-NPTH.drl [if mounting holes exist]
Exporting Gerbers from EasyEDA
In EasyEDA (online):
- Open PCB editor, go to Fabrication > PCB Fabrication File (Gerber)
- EasyEDA automatically generates all required layers
- Download the ZIP file — it includes all Gerber layers plus drill files
- For JLCPCB one-click ordering: use the built-in “Order at JLCPCB” button which transfers files automatically
EasyEDA Gerber files use standard extensions and are pre-validated for JLCPCB requirements. However, always verify using a Gerber viewer before ordering from other fabs.
Gerber Verification
Always view your Gerber files in a dedicated Gerber viewer before ordering. Common issues to check:
Free Gerber Viewers
- KiCad Gerber Viewer: Built in, excellent. Supports X2 attributes display.
- Gerbv (Linux/Windows): Free, open source, reliable
- PCBWay Gerber Viewer (online): Web-based, shows exactly what the fab sees
- JLCPCB Gerber Viewer: Shows the board as it will be manufactured
What to Check
- All layers present and correct (count the files in your ZIP)
- Board outline is closed (no gaps or duplicate outlines)
- Copper pour is correctly flooded (fill appears in viewer)
- Solder mask openings align with pads (overlay copper and mask layers)
- Silkscreen does not overlap pads
- Drill holes appear in correct positions relative to copper pads
- Board dimensions match your design intent
- No unintentional copper shorting
Ordering at JLCPCB: India Guide
JLCPCB is the most popular fab for Indian electronics hobbyists and startups due to its low pricing and fast DHL delivery. Here is what to know:
Standard 2-Layer Order (Most Common)
- Price: From $2 for 5 pieces (100 x 100mm or smaller)
- Lead time: 24-48 hours manufacturing + 5-7 days DHL to India
- Total landed cost: ~Rs 1500-2500 (board + DHL + import duty at 18% IGST on declared value)
JLCPCB Gerber Requirements
- Compress all files into a single ZIP (not nested ZIPs)
- Include only one board outline file
- Their Gerber checker at upload validates files automatically
- If using EasyEDA: use the one-click “Order at JLCPCB” for automatic file transfer
Cost-Saving Tips for India
- Keep board size under 100 x 100mm to stay in the cheapest pricing tier
- Order 5 pcs minimum (JLCPCB’s minimum for prototype pricing)
- Declare accurate commercial value to avoid customs issues — undervaluation can cause delays
- Use JLCPCB Economy shipping for non-urgent orders (2-3 weeks, cheaper)
- Bundle multiple designs in one order using V-cut panelization to reduce per-board shipping cost
Components for Your PCB Build
After your PCBs arrive, these components integrate well with custom designs:
- Waveshare ESP32-S3 Nano — Compact IoT module to integrate with your custom PCB
- Arduino UNO R3 — Development board for prototyping before custom PCB fabrication
- Arduino Nano USB Cable — For programming embedded microcontrollers
Pre-Order Gerber Checklist
- All copper layers exported (2 for 2-layer, 4 for 4-layer)
- Both solder mask layers included
- Both silkscreen layers included
- Both paste layers included (if ordering stencil)
- Board outline (Edge.Cuts/GKO) is a single closed shape
- Drill files included (PTH + NPTH separate or combined)
- Gerbers verified in viewer (board shape correct, pads visible, mask openings aligned)
- Layer count in EDA tool matches order form
- Board thickness specified (standard 1.6mm unless specified)
- Copper weight specified (standard 1oz/35um unless high current)
- Surface finish specified (HASL, ENIG, etc.)
- All files in single ZIP archive
Frequently Asked Questions
What is the difference between Gerber RS-274X and Gerber X2?
RS-274X is the traditional extended Gerber format universally supported by all fabs. Gerber X2 adds layer attribute metadata in the file header, allowing fabrication software to automatically identify layer types. X2 is backward compatible — fabs that support RS-274X can process X2 files by ignoring the metadata attributes. Use X2 when available (KiCad 6+).
Do I need to include all layers in my Gerber package?
For a basic 2-layer PCB: include top copper, bottom copper, top mask, bottom mask, top silkscreen, and board outline (drill files mandatory). Silkscreen and paste layers are optional but should be included. Never omit copper layers or the board outline.
Why does my Gerber look different from my PCB design?
Common reasons: solder mask is displayed as a negative (openings visible, not the mask coating), copper fills may need to be re-flooded before export (in KiCad, use Edit > Fill All Zones before exporting), or the viewer displays each layer independently. Always overlay layers in the viewer to see the complete picture.
Can I get PCBs made in India from Gerber files?
Yes. Domestic manufacturers like PCBPower (Gandhinagar), Eurocircuits (Indian office), and several Bengaluru-based fabs accept standard Gerber + drill files. For simple 2-layer boards, JLCPCB (China) is often cheaper for quantities under 50 pieces due to aggressive prototype pricing and reliable DHL delivery.
What is a Gerber drill file and why is it separate?
Drill files use Excellon format (not Gerber) because they drive a different machine — the CNC drill. The Excellon format defines tool sizes (drill diameters) and XY coordinates for each hole. It is a separate file type but always included in the “Gerber package” because PCB fabrication requires both layer imaging and drilling.
Start Building Your Custom PCB
Find cables, connectors, and electronic components to complement your custom PCB designs at Zbotic.
Add comment