The Complete Guide to Gerber File Formats: PCB Gerber (RS-274X, GBR), Excellon Drill Files, ODB++, DXF & More – Specifications, Examples & Downloads

For PCB fabrication, we require PCB design file in Gerber RS-274X format (most preferred), *.PCB/DDB (Protel, inform your program version) format or *.BRD (Eagle) format. 

What is the Gerber File Format?

History and Evolution

The Gerber File Format has a rich history dating back to the 1960s. Originally developed by the Gerber Systems Corporation, it has undergone significant evolution to keep pace with the advancing complexity of PCB designs.

  • RS-274-D: The original Gerber format, also known as Standard Gerber, was based on the RS-274-D standard. This format required a separate aperture file to define the shapes used in the design.

  • RS-274X: Introduced in the 1990s, RS-274X, or Extended Gerber, is the current industry standard. It incorporates aperture definitions within the file itself, streamlining the PCB manufacturing process.

Why Gerber Became the Industry Standard

Gerber files became the go-to format for several reasons:

  1. Simplicity: The format is straightforward, making it easy for both designers and manufacturers to work with.
  2. Universality: Almost all PCB design software can export Gerber files, and all PCB manufacturers can read them.
  3. Accuracy: Gerber files provide a high level of precision, crucial for complex PCB designs.
  4. Compatibility: The format has maintained backward compatibility while evolving to meet new needs.

Communicating PCB Design Data

Gerber files act as a universal language between designers and manufacturers. They contain all the necessary information to produce each layer of a PCB, including:

Each aspect of the board is typically represented in a separate Gerber file, allowing for precise control over the manufacturing process.

RS-274D vs. RS-274X

While RS-274D is now obsolete, understanding its differences from RS-274X helps in appreciating the format’s evolution:

FeatureRS-274DRS-274X
Aperture definitionsSeparate fileEmbedded in the Gerber file
File complexityMultiple files neededSelf-contained
Industry supportPhased outCurrent standard
Layer informationLimitedComprehensive

The shift to RS-274X significantly simplified the PCB manufacturing process by reducing the potential for errors associated with managing multiple files.

2. Understanding RS-274X (Extended Gerber)

RS-274X, also known as Extended Gerber, represents a significant leap forward in PCB design file formats. Its enhancements over the older RS-274D standard have made it the preferred choice for PCB designers and manufacturers worldwide.

Key Enhancements of RS-274X

  1. Embedded Apertures: Aperture definitions are included within the Gerber file itself, eliminating the need for separate aperture files.

  2. Layer Information: RS-274X files can contain metadata about the PCB layer they represent, enhancing clarity in the manufacturing process.

  3. Advanced Imaging: Support for negative image polarity and step and repeat operations, allowing for more complex designs.

  4. Improved Precision: RS-274X supports a higher degree of precision in coordinate data.

Typical Structure of an RS-274X File

An RS-274X file generally consists of the following sections:

  1. Headers: Contains general information about the file and its contents.
  2. Aperture Macros: Defines custom aperture shapes.
  3. Aperture Definitions: Specifies the apertures used in the file.
  4. Image Data: The actual PCB design data, consisting of draws and flashes.
  5. End of File: A marker indicating the end of the Gerber data.

Real-world Example: RS-274X File Snippet

Here’s a simplified example of what you might find in an RS-274X file:

G04 RS-274X Example File*
%FSLAX36Y36*%
%MOMM*%
%LPD*%
%ADD10C,0.100000*%
%ADD11R,1.000000X2.000000*%
D10*
X0Y0D02*
X10000000Y0D01*
D11*
X5000000Y5000000D03*
M02*

Let’s break down this example:

  • G04: Comment line
  • %FSLAX36Y36*%: Sets the coordinate format (3.6 – 3 integer and 6 decimal places)
  • %MOMM*%: Sets units to millimeters
  • %LPD*%: Sets the polarity to “dark”
  • %ADD10C,0.100000*%: Defines aperture D10 as a circle with a 0.1mm diameter
  • %ADD11R,1.000000X2.000000*%: Defines aperture D11 as a rectangle 1mm x 2mm
  • D10*: Selects aperture D10
  • X0Y0D02*: Moves to coordinate (0,0) without drawing
  • X10000000Y0D01*: Draws a line to coordinate (10,0)
  • D11*: Selects aperture D11
  • X5000000Y5000000D03*: Flashes aperture D11 at coordinate (5,5)
  • M02*: End of file

Understanding this structure is crucial for troubleshooting and verifying Gerber files before sending them to manufacturers.

3. Overview of Common Gerber File Extensions

When working with Gerber files, you’ll encounter various file extensions. Each extension typically corresponds to a specific layer or aspect of the PCB design. Understanding these extensions is crucial for organizing your design files and communicating effectively with manufacturers.

Common Gerber File Extensions

ExtensionDescription
.gbrGeneric Gerber file
.gtlTop copper layer
.gblBottom copper layer
.gtsTop solder mask
.gbsBottom solder mask
.gtoTop silkscreen
.gboBottom silkscreen
.gm1Mechanical layer 1 (often used for board outline)
.drlDrill file (typically in Excellon format)

Layer Explanations

  1. Top Copper Layer (.gtl): Contains the copper traces, pads, and planes on the top side of the PCB.

  2. Bottom Copper Layer (.gbl): Similar to the top layer, but for the bottom side of the PCB.

  3. Solder Mask Layers (.gts, .gbs): Define areas where solder mask should be applied or removed, typically covering all areas except pads and vias.

  4. Silkscreen Layers (.gto, .gbo): Contain text, component outlines, and other markings printed on the PCB surface.

  5. Mechanical Layer (.gm1): Often used for the board outline, but can also include assembly notes or dimensions.

  6. Drill File (.drl): While not a Gerber file, the drill file is crucial as it specifies the location and size of all holes in the PCB.

Importance of File Naming and Extensions

Proper file naming and use of standard extensions are critical for several reasons:

  1. Clarity: Clear naming helps both designers and manufacturers quickly identify each layer’s purpose.

  2. Automation: Many PCB manufacturing processes are automated and rely on standardized file names.

  3. Error Prevention: Correct naming reduces the risk of layer mix-ups during manufacturing.

  4. Efficiency: Standardized naming speeds up the design review and manufacturing preparation processes.

Always check with your PCB manufacturer for their specific file naming requirements, as they may have slight variations in their preferred naming conventions.

4. Excellon Drill Files Explained

While not part of the Gerber format, Excellon drill files are an essential component of PCB manufacturing data. They work in conjunction with Gerber files to provide a complete description of the PCB design.

What are Excellon Drill Files?

Excellon drill files, typically with a .drl extension, contain information about the location and size of all holes in a PCB. This includes:

  • Through-holes for component leads
  • Vias for connecting different layers
  • Mounting holes
  • Other mechanical holes

The Excellon format is named after the Excellon Automation Company, a major manufacturer of PCB drilling equipment.

Why Drill Files are Separate from Gerber

Drill files are kept separate from Gerber files for several reasons:

  1. Historical precedent: Drilling was often a separate process in PCB manufacturing.
  2. Flexibility: Allows for easier modification of drill data without affecting other aspects of the design.
  3. Machine specificity: Drill files can be tailored to specific drilling equipment.

Excellon File Structure

A typical Excellon drill file consists of three main sections:

  1. Header: Contains general information and settings.
  2. Tool Definition: Specifies the sizes of drill bits to be used.
  3. Drill Data: Lists the coordinates for each drill operation.

Example of a Basic Excellon File

Here’s a simplified example of an Excellon drill file:

M48
;DRILL file {KiCad 5.1.5-52549c5~86~ubuntu18.04.1} date 2023-07-15T10:30:52
;FORMAT={-:-/ absolute / inch / decimal}
FMAT,2
INCH
T1C0.0157
T2C0.0394
%
G90
G05
T1
X5.1Y3.2
X5.2Y3.3
T2
X4.9Y3.0
X5.0Y3.1
T0
M30

Let’s break this down:

  • M48: Start of the header
  • ;DRILL file...: Comment line with file information
  • FMAT,2: File format
  • INCH: Units (inches in this case)
  • T1C0.0157: Define Tool 1 with a diameter of 0.0157 inches
  • T2C0.0394: Define Tool 2 with a diameter of 0.0394 inches
  • %: End of the header
  • G90: Use absolute positioning
  • G05: Drill mode
  • T1: Select Tool 1
  • X5.1Y3.2: Drill a hole at coordinates (5.1, 3.2)
  • T0: End of the program
  • M30: End of the file

Key Tips for Preparing Drill Files

  1. Use the correct units: Ensure your drill file uses the same units (inches or millimeters) as your Gerber files.
  2. Check drill sizes: Verify that all drill sizes are standard and available to your manufacturer.
  3. Avoid overlapping holes: Ensure adequate spacing between holes to maintain board integrity.
  4. Include plated and non-plated holes: Clearly differentiate between plated and non-plated holes if your design requires both.

By understanding and correctly preparing Excellon drill files, you can ensure that your PCB design is accurately translated into a physical board.

5. Alternatives and Evolving Standards: ODB++ and IPC-2581

ODB++ Vs. Gerber

While the Gerber File Format remains the industry standard, newer formats have emerged to address some of its limitations. Two notable alternatives are ODB++ and IPC-2581.

Introduction to ODB++

ODB++ (Open Database++) is a proprietary PCB design exchange format developed by Mentor Graphics (now part of Siemens). It aims to provide a more comprehensive and intelligent data set compared to traditional Gerber files.

Key features of ODB++:

  1. Unified format: Combines design, fabrication, and assembly data in a single file.
  2. Intelligent data: Includes netlist information, component data, and material stackups.
  3. Reduced ambiguity: Minimizes the risk of misinterpretation during manufacturing.
  4. Version control: Supports easier tracking of design changes.

Brief Look at IPC-2581

IPC-2581 is an open, vendor-neutral standard developed by the IPC (Association Connecting Electronics Industries). It aims to streamline the PCB manufacturing process by providing a single, comprehensive data format.

Key aspects of IPC-2581:

  1. Comprehensive data: Includes design, fabrication, and assembly information in one file.
  2. Open standard: Not controlled by any single company, promoting wider adoption.
  3. Backwards compatibility: Can represent all data currently in Gerber and Excellon formats.
  4. Future-proof: Designed to accommodate evolving PCB technologies.

Why Gerber Remains Dominant

Despite the advantages of newer formats, Gerber files continue to dominate the PCB industry for several reasons:

  1. Universal acceptance: Nearly all PCB design software can export Gerber files, and all manufacturers can read them.
  2. Simplicity: The format is straightforward and well-understood by industry professionals.
  3. Proven track record: Gerber files have been reliably used for decades.
  4. Incremental improvements: The Gerber format continues to evolve, addressing many of its historical limitations.

While ODB++ and IPC-2581 offer advantages in terms of data richness and reduced ambiguity, the PCB industry’s reliance on established workflows and tools has slowed their adoption. However, as PCB designs become more complex, these newer formats may see increased use in the future.

6. Using DXF Files in PCB Design

While Gerber files are the standard for PCB manufacturing, DXF (Drawing Exchange Format) files play a crucial role in certain aspects of PCB design, particularly in defining board outlines and creating mechanical drawings.

What are DXF Files?

DXF is a CAD data file format developed by Autodesk for enabling data interoperability between AutoCAD and other programs. In PCB design, DXF files are often used for:

  1. Defining complex board outlines
  2. Creating mechanical drawings
  3. Designing enclosures or cases for the PCB
  4. Communicating with mechanical engineers or industrial designers

DXF in PCB Design Workflow

  1. Board Outlines: For PCBs with non-standard shapes, designers often create the outline in a mechanical CAD program and import it into their PCB design software as a DXF file.

  2. Mechanical Constraints: DXF files can define keep-out areas, mounting holes, or other mechanical features that the PCB must accommodate.

  3. Documentation: DXF files are useful for creating detailed mechanical drawings of the PCB, including dimensions and annotations.

When DXF to Gerber Conversion is Needed

While many PCB design tools can work directly with DXF files for board outlines, there are situations where conversion to Gerber format is necessary:

    1. Manufacturing requirements: Some PCB manufacturers prefer all data, including the board outline, in Gerber format.

    2. Software limitations: Older or more basic PCB design tools might not support DXF import, requiring conversion to Gerber.

    3. Design verification: Converting DXF to Gerber allows for easier verification of the board outline within PCB design software.

    4. Consistency: Having all PCB data in Gerber format ensures consistency across all layers and simplifies the manufacturing process.

Best Practices for Using DXF Files in PCB Design

  1. Use a single continuous polyline for the board outline to avoid gaps or overlaps.
  2. Ensure all dimensions in the DXF file match your PCB design units (inches or millimeters).
  3. Clean up unnecessary data in the DXF file before importing it into your PCB design software.
  4. Verify the imported outline in your PCB design tool before proceeding with component placement.

7. How to View and Verify Gerber Files

view-gerber-files

Certainly, I’ll continue from where we left off:

  1. Design verification: Converting DXF to Gerber allows for easier verification of the board outline within PCB design software.

  2. Consistency: Having all PCB data in Gerber format ensures consistency across all layers and simplifies the manufacturing process.

Best Practices for Using DXF Files in PCB Design

  1. Use a single continuous polyline for the board outline to avoid gaps or overlaps.
  2. Ensure all dimensions in the DXF file match your PCB design units (inches or millimeters).
  3. Clean up unnecessary data in the DXF file before importing it into your PCB design software.
  4. Verify the imported outline in your PCB design tool before proceeding with component placement.

7. How to View and Verify Gerber Files

Proper verification of Gerber files is crucial to ensure that your PCB design will be manufactured correctly. There are several tools available for viewing and verifying Gerber files, ranging from free open-source options to professional paid software.

Free Gerber Viewers

  1. Gerbv: An open-source viewer that’s part of the gEDA project. It’s fast, lightweight, and supports both Gerber and Excellon drill files.

  2. KiCad Gerber Viewer: Included with the open-source KiCad EDA suite, this viewer is user-friendly and supports a wide range of Gerber file formats.

  3. CircuitMaker Gerber Viewer: A free online viewer provided by Altium, allowing you to view Gerber files without installing any software.

Paid Professional Viewers

  1. Altium Viewer: A powerful tool that can open native Altium Designer files as well as Gerber files.

  2. CAM350: A comprehensive tool for viewing, editing, and analyzing PCB manufacturing data.

  3. GerberLogix: Offers advanced features like netlist comparison and 3D visualization.

Importance of Pre-manufacturing Verification

Verifying your Gerber files before sending them to manufacturing is crucial for several reasons:

  1. Catch Design Errors: Identify issues like missing layers, incorrect trace widths, or misaligned drill holes.

  2. Ensure Manufacturability: Check that your design meets the manufacturer’s capabilities and design rules.

  3. Prevent Costly Mistakes: Catching errors before manufacturing saves time and money on board respins.

  4. Confirm Design Intent: Ensure that the Gerber files accurately represent your intended design.

Verification Checklist

When verifying your Gerber files, consider the following:

  1. Check that all required layers are present (copper, solder mask, silkscreen, etc.).
  2. Verify the board outline matches your design.
  3. Ensure all drill holes are present and correctly sized.
  4. Check for any unintended copper areas or traces.
  5. Verify text and component markings are readable and correctly placed.
  6. Confirm that pad sizes and shapes are correct.
  7. Check for any violation of minimum trace width or spacing rules.

By thoroughly verifying your Gerber files before submission, you greatly increase the chances of a successful PCB manufacturing process.

8. Best Practices for Generating and Exporting Gerber Files

Properly generating and exporting Gerber files is crucial for ensuring your PCB design is accurately translated into a physical board. Here are some best practices to follow:

Export Settings Checklist

  1. Units: Ensure your export units (inches or millimeters) match your design units.

  2. Precision: Set appropriate precision for coordinates (e.g., 2:5 or 2:6 for inches, meaning 2 digits before the decimal point and 5 or 6 after).

  3. Format: Use RS-274X (Extended Gerber) format.

  4. Layers: Export all necessary layers, including copper, solder mask, silkscreen, and drill files.

  5. Apertures: Use embedded apertures (available in RS-274X) rather than separate aperture files.

  6. Zero Suppression: Choose between leading or trailing zero suppression consistently.

  7. Drill Format: For drill files, specify whether to use Excellon or Gerber format, depending on manufacturer requirements.

Common Mistakes to Avoid

  1. Missing Layers: Forgetting to export critical layers like solder mask or silkscreen.

  2. Incorrect Scale: Ensure your design is exported at 1:1 scale.

  3. Mismatched Units: Mixing inches and millimeters across different files.

  4. Insufficient Precision: Using too low precision can lead to rounding errors in fine details.

  5. Ignoring DRC: Failing to run and resolve Design Rule Checks before exporting.

  6. Outdated Formats: Using obsolete formats like RS-274D instead of RS-274X.

  7. Inconsistent Naming: Using non-standard or unclear file naming conventions.

Manufacturer-Specific Requirements

Always check with your PCB manufacturer for their specific requirements, which may include:

  1. File Naming Conventions: Specific prefixes or suffixes for each layer.

  2. Layer Stackup: Specific order of layers in multi-layer boards.

  3. Drill File Format: Preference for Excellon or Gerber format for drill data.

  4. Copper Thieving: Requirements for copper balancing on outer layers.

  5. Panel Size: Specifications for panelizing multiple boards.

  6. Material Requirements: Any specific callouts needed for board material or thickness.

  7. Special Instructions: How to communicate non-standard requirements or features.

By following these best practices and checking manufacturer-specific requirements, you can significantly reduce the chances of errors in the PCB manufacturing process.

9. Downloadable Examples: Sample Gerber Files

To help you better understand the Gerber File Format, we’ve prepared a set of sample Gerber files for a simple two-layer PCB design. These files demonstrate the typical components of a complete Gerber file set for PCB manufacturing.

Sample Gerber File Package Contents

Our sample package includes the following files:

  1. example_top_copper.gtl – Top copper layer
  2. example_bottom_copper.gbl – Bottom copper layer
  3. example_top_solder_mask.gts – Top solder mask
  4. example_bottom_solder_mask.gbs – Bottom solder mask
  5. example_top_silkscreen.gto – Top silkscreen
  6. example_bottom_silkscreen.gbo – Bottom silkscreen
  7. example_board_outline.gm1 – Board outline
  8. example_drill_file.drl – Excellon drill file

You can download the zipped package of these sample files here: Download Sample Gerber Files

Using the Sample Files

These files can be used for:

  1. Practice in Gerber file viewing and verification
  2. Understanding the structure of different layer files
  3. Testing Gerber viewers or CAM software
  4. Learning how to interpret Gerber and drill data

Remember, these are simplified examples and may not represent all the complexities of a real-world PCB design. However, they provide a good starting point for understanding the Gerber File Format.

10. Conclusion and Further Resources

Understanding the Gerber File Format is crucial for anyone involved in PCB design and manufacturing. As we’ve explored in this guide, Gerber files serve as the universal language between designers and manufacturers, ensuring that complex PCB designs are accurately translated into physical boards.

Key Takeaways

  1. The Gerber File Format, particularly RS-274X, is the industry standard for PCB design data exchange.
  2. Proper preparation and verification of Gerber files are essential for successful PCB manufacturing.
  3. While alternatives like ODB++ and IPC-2581 exist, Gerber remains dominant due to its simplicity and universal acceptance.
  4. Understanding file extensions, layer structures, and best practices for file generation can significantly reduce manufacturing errors.

Importance of Double-Checking

Always double-check your Gerber files before sending them to fabrication. This simple step can save time, money, and frustration by catching errors early in the process.

Further Reading and Resources

To deepen your understanding of PCB design and Gerber files, consider exploring these resources:

  1. Ucamco’s Official Gerber Format Specification
  2. IPC-2581 Standard for Electronics Manufacturing
  3. PCB Design Best Practices Guide
  4. KiCad EDA Software Documentation
  5. Altium’s PCB Design Resources

By mastering the Gerber File Format and staying informed about evolving standards, you’ll be well-equipped to navigate the intricacies of PCB design and manufacturing, ensuring your projects move smoothly from concept to reality.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.