Skip to content

How to Generate the Gerber Files


Gerber files are the industry standard format for printed circuit board (PCB) manufacturing. They provide all the information a PCB manufacturer needs to fabricate your board, including copper layers, solder mask, silkscreen, drill data, and more. As a PCB designer, you’ll need to be able to generate Gerber files from your EDA (electronic design automation) software to send your finished board layout off for production. This comprehensive guide will walk you through the entire process of exporting Gerber files, from understanding the different file types to setting up your layers correctly. With the right preparation, you’ll be able to produce the accurate Gerber files required to turn your design into a physical reality.

The Gerber Format

Gerber files use a standardized numeric format (RS-274X) to convey PCB layout data like images, coordinates, and commands. The files describe each layer of the board layout separately, such as copper, silkscreen, solder mask, drill holes, etc. By separating the data into different files, PCB manufacturers can selectively choose which layers to image during the fabrication process. This eliminates the need to rebuild the entire board layout from a single massive data file.

Some key properties of the Gerber format include:

  • Vector Images – Gerber files use vectors to describe shapes like lines, arcs, and circles that make up tracks and outlines. This makes the format very compact compared to bitmapped images.
  • Apertures – Apertures define the size and shape of the vector. They allow features like pad diameters and track widths to be adjusted by simply changing the aperture.
  • Coordinates – Each vector endpoint is defined by X and Y coordinates that locate features accurately. The coordinates use metric units down to nanometer precision.
  • RS-274X Language – Standardized commands are used for selecting apertures, setting coordinates, interpolating lines/arcs, etc.

By adhering to the standardized RS-274X format, Gerber files can be loaded directly into PCB fabrication equipment without the need for conversion or preprocessing. This avoids errors and keeps the data intact as it moves through the manufacturing process.

Layer Types

Figure 3 Gerber Setup Dialogue Box opens

A fabricated PCB is made up of a number of physical layers that are stacked and bonded together. Gerber files are required to define the data for each individual layer. Here are some of the most common layer types:

Copper Layers

The copper layers contain the conductive tracks, pads, and vias that make up the circuit. There is often a top and bottom copper layer, and also inner layers if using a multilayer board. Each copper layer has its own Gerber file.

Solder Mask Layers

Solder mask is the protective coating that is applied over the copper to prevent solder bridges. The solder mask layers are essentially negative images that define the areas where solder mask should be absent (such as over pads).

Silkscreen Layers

The silkscreen is decorative printing on the PCB. It is used for markings like component designators, logos, board outlines, etc. Silkscreen layers use the Gerber format to define the graphics to be printed.

Drill Files

Drill files specify the locations and sizes of holes to be drilled in the PCB. This includes through-holes for component leads as well as non-plated mechanical holes. Excellon is the most common drill file format.

Assembly Drawings

Assembly files define pick and place data for population of components on the bare PCB. This aids automated assembly and is optional for basic fabrication.

Project Setup Guidelines

Before you can generate proper Gerber files, the PCB project needs to be set up correctly. Here are some key guidelines to follow:

Coordinate System

The coordinate system used should match the PCB manufacturer’s specifications:

  • Origin – Bottom left corner of the board
  • Axes – X horizontal, Y vertical
  • Units – Metric (mm)
  • Rotation – No rotation

This avoids extra processing by the fabricator to align to their system.

Layer Stackup

The layer order and materials should follow the fabricator’s layer stackup convention. A typical example is:

  1. Top Silkscreen
  2. Top Solder Mask
  3. Top Copper
  4. Inner Copper Layers…
  5. Bottom Copper
  6. Bottom Solder Mask
  7. Bottom Silkscreen

Consult your manufacturer’s guidelines and match the sequence in your EDA tool.

Design Rules

Set your track widths, clearances, via sizes, etc. to comply with the fabricator’s design rules for the selected PCB technology. This ensures the layout is manufacturable.

Net Names

Use a consistent naming convention like “GND”, “VCC”, “+5V” for power nets. Avoid changing net names mid-trace as this can confuse fabrication data.

Output Generation

Gerber Files
Gerber Files

Once the project is properly configured, generating the Gerber files is straightforward. Here is the general process:

Cam File Generation

Your EDA tool will have an option to generate cam, photoplot, or fabrication output files from your board layout. Select the appropriate output profile that matches your board technology (e.g. “2 Layer FR-4”). This will generate all required layer Gerber files along with drill, netlist and other fabrication data.

Layer Checking

Thoroughly inspect each layer file to ensure the contents match the source PCB layout. Check for missing traces, incorrect apertures, misaligned layers, etc. Any errors can lead to costly fabrication mistakes.

File Naming

Give the output files clean, consistent names indicating the layer type and order sequence:

  • TopSilkscreen.gbr
  • TopSolderMask.gbr
  • TopCopper.gbr

Avoid using spaces, special characters, and overly long names.

Compressing and Archiving

Zip/archive the complete set of Gerber files together for easier transfer. Avoid compressing individual files as it can confuse CAM systems.

Transferring to Manufacturer

Upload the Gerber archive to the PCB manufacturer through their website portal or send via email. Wait for the files to be checked before proceeding with your order.

Tips for Success


Follow these tips to avoid common mistakes and ensure your Gerber files generate accurately:

  • Stay Organized – Keep your PCB layers well structured and named consistently through the design process. Disorganization leads to data mix ups.
  • Follow Standards – Use the manufacturer’s recommended stackup, design rules, and layer settings. Never deviate unless approved.
  • Design Rule Check – Run DRC on your board layout and fix any errors before generating output files. This catches problems early.
  • Double Check Layers – Verify critically that each layer matches your source data. Don’t rely on the CAM process blindly.
  • Communicate Changes – Inform your manufacturer if you need to revise the Gerber files after initial submission. Send the full updated set.
  • Learn from Experience – If you have fabrication issues with your first builds, analyze the cause and improve your Gerber generation process.

Gerber File Viewing and Verification

Since Gerber files contain crucial fabrication data, it is essential to review them carefully for potential problems before sending them out. Here are some tips on how to validate your Gerber files:

Use a Gerber Viewer

A Gerber viewer is specialized software that loads the standard RS-274X files and renders the visual contents for inspection. This provides the most realistic validation of how the manufactured PCB will turn out. Some good free options are GC-Prevue and Gerbv.

Check Layer Alignment

When overlaying layers in a viewer, check that features line up properly across layers. Misalignments lead to etched copper being in the wrong place.

Inspect Apertures and Graphics

Verify apertures are sized correctly and vector graphics render sharply without glitches. Any artifacts could indicate aperture, format, or resolution issues.

Compare vs Source File

Overlay the Gerber layers atop your source PCB data to compare signal-to-signal. Any discrepancies in tracks or pads will show up.

Analyze DRC Reports

Even if your source file passes DRC checks, run DRC on the Gerber files themselves. The CAM process can sometimes introduce new errors.

View Drills & Holes

Inspect drill layers to ensure hole sizes are correct and holes align precisely with pad stackups.

Confirm Critical Data

Double check critical identifiers like designators, component outlines, board dimensions, and text are rendered clearly and without errors.

Thorough Gerber file inspection is the last line of defense against expensive PCB fabrication errors. Spending extra time validating can save you money and headaches down the road.

Converting Gerber to Drill Files

PCB Drilling machine
PCB Drilling machine

While Gerber files define the layered 2D data of a PCB layout, drill files specify the actual hole sizes and locations required to fabricate the board. Excellon (.drl) is the standard format for drill data. Here is an overview of how drill files are derived from Gerber:

1. Identify Hole Locations

The locations of all required holes are determined from the component pads and vias defined in the Gerber copper layers. PCB CAM tools extract the X/Y coordinates of every pad/via.

2. Define Hole Sizes

Each pad or via has a associated finished hole size defined during PCB layout. These hole sizes are mapped to the extracted hole locations.

3. Optimize Hole Grouping

To optimize the drilling process, holes are grouped into “tool lists” based on having the same drill bit size. This minimizes tool changes.

4. Generate Excellon File

The formatted Excellon file (.drl) is output containing tool definitions and hole coordinates. The data is organized to facilitate efficient drilling.

5. Add Routing Attributes

Additional routing attributes direct the PCB drilling machine like spindle speeds, tool change positions, and drill cut depths for partially drilled boards.

6. Validate vs Gerber Layers

It is critical to validate the drill file against the source Gerber data to ensure the proper hole sizes and locations transfer over as expected.

With an accurate drill file derived from the layout, the PCB manufacturer can drill all holes to precisely match up with the layered circuit board data.

Advanced Gerber Techniques

For complex PCB projects, additional steps and advanced Gerber techniques may be required:

SolderPaste Files

Solder paste files indicate the precise solder paste distribution required to place and solder surface-mount components. This is often defined as a separate layer.

Removing Explicit Zeroes

Certain CAM systems can misinterpret surplus “zero” command codes. Stripping these out avoids problems.

Simplifying Apertures

Reducing the number of unique apertures in the files helps performance for some fabricators. CAM tools can consolidate apertures.

Polarity Markings

For double-sided boards, adding a small “polarity mark” hole at a standard location aids in orienting and aligning layers.

Routed Tab and Panel Design

Panelization features like tooling tabs, mouse bites, and break-off rails are added for PCB depanelization.

Layer Alignment Markings

Fiducials that appear on multiple layers can provide visual cue points for aligning layers during fabrication.

As you gain experience, continue exploring new Gerber techniques to enhance your fabrication capabilities. The standard allows ample flexibility.


Gerber files are integral to turning your completed PCB layout into a physical board. By understanding the specialized data format, planning your project correctly, thoroughly inspecting your files, and employing advanced techniques, you can generate accurate Gerber files the first time. With clean, error-free data, you will avoid costly delays and re-spins during fabrication. Spending extra time up front to polish your Gerber file creation process ultimately saves you frustration, time, and money further down the line.

Summary of Main Points:

  • Gerber format uses succinct vector data to convey PCB layout information layer-by-layer.
  • Typical layers include copper, solder mask, silkscreen, drill data. Each must have a Gerber file generated.
  • Set up your PCB project according to manufacturer’s guidelines for flawless data output.
  • Carefully inspect all layers for alignment errors or missing data before sending files out.
  • Excellon drill files are derived from copper pad/via locations and holes sizes defined in your layout.
  • Advanced techniques like solder paste layers and panelization require additional data.
  • Take time to refine your Gerber generation process and you’ll produce fabrication-ready files the first time.

Frequently Asked Questions

  1. Why are Gerber files needed for PCB manufacturing?

Gerber files are the standard format that PCB fabrication equipment understands. The files provide the precise layered data needed to image the conductors, solder mask, markings, drill locations, etc. without errors. Trying to fabricate directly from CAD or source layout files would be prone to mistakes.

  1. How accurate are the coordinates in Gerber files?

The Gerber format supports metric coordinates to a precision down to ten nanometers. This allows traces, pads, and holes to be located extremely accurately for high density PCB designs. The precision avoids rounding errors over long distances.

  1. Can you edit Gerber files?

While it is possible to make edits to Gerber files with specialized tools, it is not recommended. The ideal workflow is modifying the source PCB layout, then regenerating clean Gerber output. Direct Gerber edits often lead to conflicts between layers.

  1. What are the main advantages of Gerber X2 format?

Gerber X2 allows greater precision, smaller apertures, step and repeat panelization, embedded component and net properties, and other enhancements. However, adoption of X2 has been slow since traditional RS-274X works well.

  1. How are irregularly shaped traces defined in Gerber files?

Irregular pad/trace geometries are approximated using very short vector segments. Smaller segment lengths increase the precision but also increase file size. There is a tradeoff between accuracy and efficiency.

1.Gerber Files Introduction

Gerber file format is a defacto standard used by PCB manufacturing industry. This is analogous to produce a *.pdf file after designing a graphics or text document. Almost everyone who is involved in PCB design either hobbyist or commercial designer may have used it. It is actually an ASCII file format.

Gerber file format is evolved from applications where it is used to re-create images or graphics i.e., printers and plotters industry. In the same way it is used  in electronics hardware industry to print PCB tracks, holes, clearances and all information which is contained in a *.pcb design file. The leading PCB CAD softwares are able to create gerber files as an output of PCB design file.  These softwares generally use RS-274-X Gerber file format because it is newer and easy to handle data files.

A gerber file is divided into the following four subparts:

  • Configuration Parameters
  • Aperture Definitions
  • Drawing Commands
  • X/Y Coordinates

Each file extension denotes a specific PCB layer such as:

Top Layer => *.gtl

Bottom Layer => *.gbl

Keepout Layer => *.gko

TopOverlay Layer => *.gto

BottomOverlay Layer => *.gbo etc.

2.Generating Gerbers: An example

The softwares have a feature to execute gerber output generate command. Usually, it is a dialogue box which has enable and disable options to include and exclude certain layers and parameters to include or exclude from gerber output files. In RS-274-X file format one file is produced for each one layer of PCB design file.

For instance in protel 99se PCB design software:

The gerber files generator can be launched from (PCB editor) Tools> Generate Gerber files command.

The following CAM Options dialogue box opens:

Figure 1: Setup for Gerber output

However, every software has its own style of creating Gerbers files. They may have small differences compared to others to execute commands. Set of commands that how to generate Gerbers in specific software are best explained in the respective software manual. This example is produced to guide about the process step by step.

The dialog box in Figure 1, produces settings for location to save output gerber files. Almost all PCB designers know to set the folder and file path in a desktop computer.

Figure 2: Gerbers Settings Dialogue Box

The dialogue box in Figure 2, appears to make settings that what to include in the gerber files command, if executed. The first pane makes resolution of scan. The description below to the dialogue box is self-explanatory and can be chosen by clicking the respective radio-box. Higher resolution occupies more memory but have better data precision. There are two settings: the metric (mm) system and imperial (inches) system of units. Gerbers in both formats can be generated. However, for data clarity and to be safe side, generate Gerbers in both mm and inches format, in two separate folders with clearly mentioning their units type.

The next pane in this dialogue box is layers settings where different layers can be enabled to include or exclude in the output files. Generally, it is a good option to “enable all used layers”.

Drill drawing and mechanical layers panes make settings about drill drawing and mechanical layers respectively.

Apertures settings is used for thickness of tracks used and advanced is used some other settings. For producing gerber files it is a good practice to consult with your PCB manufacturer.

Figure 3: Settings Dialogue Box for NC drill files

The NC drill files setup produces PCB holes location and drill size information just like the gerber files i.e., location and size of drill. This also has the same settings and parameters as in Gerber files step. Produce the NC Drill files alongwith gerber files.

3.What Should Include In Gerber Files

In a gerber file following layers and information should be added:

  1. Signal layers: All signal layers which are used in the PCB design or those carry electrical signals should be enabled to produce its gerber file.
  2. Plane layers: Similar to signal layers all plane layers should also be enabled to produce gerber output files. These are solid coper layers which distribute power.
  3. Keepout layer: Keepout layer is electrical boundaries of the board. This can also be used to board cutting boundary.
  4. Mechanical layers: The used mechanical layers should also be enabled.  A mechanical layer may not have any electrical information like in signal layer or plane layers. However, they can have some information about mechanical parameter like PCB cutting or fixing in enclosures.
  5. Overlays: The top overlay and bottom overlay which have information of components designators and other PCB nomenclature notes.
  6. Dimensional Information: PCB Dimensions information should be added on top overlay or mechanical or keepout layer of  PCB design file before generating gerber files.
  7. Layer stackup: Before generating gerber files add layer stackup information in any enabled mechanical layers so that manufacturer can use information about PCB material such as base material thickness, pre-preg thickness type etc.
  8. Preferably produce time and date stamped Gerber files so that they would be back traced for any query.
  9. Recheck and verify the file types using any gerber viewer software tool.
  10. If found accurate and forward to the manufacturer.

Figure 4: Gerber files enable and disable and extensions

Figure 4 shows the enable and disable of different layers view in gerber file setup dialogue box .


The gerber file format is a defacto standard of interface between a PCB Design engineer and manufacturer. Gerber format is RS-274-X 2D ASCII file format. It includes all conductive, mechanical, text and keepout layers information of a PCB design alongwith necessary notes for manufacturing.

The RS-274-X format produces one file for each layer of PCB and is preferred by the PCB industry. It is designer’s responsibility to add layers carefully to generate files. Any confusions and wrong data may cause an surprised and unwanted PCB that may be garbage only.

    GET A FREE QUOTE PCB Manufacturing & Assembly Service
    File Upload