Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.
  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.
Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
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. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.

How to Generate Gerber X2 Files in KiCad: A Complete Guide for PCB Engineers

After years of working with various PCB design tools, I’ve come to appreciate KiCad’s straightforward approach to manufacturing file generation. If you’re ready to send your design to a fab house but want to take advantage of the intelligent Gerber X2 format, you’re in the right place. This guide walks you through everything you need to know about generating Gerber X2 files in KiCad, from understanding why X2 matters to the exact settings that will get your boards manufactured correctly.

What is Gerber X2 Format and Why Should KiCad Users Care?

Gerber X2 represents a significant evolution from the traditional RS-274X format that has been the industry standard for decades. Introduced by Ucamco in 2014, Gerber X2 adds intelligent metadata (called attributes) to your manufacturing files without changing the underlying image data. This means your fab house gets more information about your design intent, reducing errors and speeding up the CAM process.

The beauty of X2 is its backward compatibility. If you generate X2 files and send them to a manufacturer using older software that only understands RS-274X, the files still work perfectly. The older software simply ignores the additional attributes and processes the image data as usual.

Key Differences Between Gerber X2 and RS-274X

FeatureRS-274X (X1)Gerber X2
Layer FunctionInferred from filenameEmbedded as attribute
File PolarityManual interpretationExplicitly defined
Pad FunctionUnknownDefined (via, component, SMD, etc.)
Net InformationNot includedCan include netlist attributes
Stack-up DataSeparate documentationEmbedded in file headers
Backward CompatibilityN/AFully compatible with X1 readers
Job File SupportNone.gbrjob file links all layers

What Gerber X2 Attributes Add to Your Files

When you enable X2 format in KiCad, each Gerber file includes standardized attributes that tell the manufacturer:

Attribute TypeInformation Provided
FileFunctionIdentifies if file is Top Copper, Bottom Solder Mask, etc.
FilePolaritySpecifies if layer is Positive or Negative
PartIndicates Single board, Panel, or Coupon
SameCoordinatesConfirms all files share the same coordinate system
CreationDateTimestamp of file generation
GenerationSoftwareIdentifies KiCad as the source application

Preparing Your KiCad Design for Gerber X2 Export

Before generating any manufacturing files, there are critical preparation steps that experienced engineers never skip. These steps prevent the most common manufacturing issues.

Run Design Rule Check (DRC)

Always run a complete DRC before exporting. In KiCad’s PCB Editor, press the DRC button or go to Inspect → Design Rules Checker. Resolve all errors and review warnings carefully. A DRC error that slips into your Gerber files can result in open circuits, shorts, or boards that can’t be manufactured.

Refill All Copper Zones

KiCad doesn’t automatically refill zones when you make changes. Press B or go to Edit → Fill All Zones to ensure your copper pours are current. If you forget this step, the Gerber files may show outdated zone fills that don’t match your intended design.

Verify Your Board Outline

The board outline on the Edge.Cuts layer must be a single, closed contour. Gaps or overlapping segments in your outline will confuse the manufacturer about where to cut. Check this layer carefully before export.

Step-by-Step Guide to Generate Gerber X2 Files in KiCad

Now let’s walk through the actual export process. These instructions apply to KiCad 7, 8, and 9, though minor interface differences may exist between versions.

Step 1: Open the Plot Dialog

With your PCB file open in the PCB Editor, navigate to File → Fabrication Outputs → Gerbers (.gbr). This opens the Plot dialog where you’ll configure all Gerber generation settings.

Step 2: Set the Output Directory

At the top of the dialog, specify where KiCad should save your files. I recommend creating a dedicated folder like “Gerbers” or “CAM” within your project directory. If the folder doesn’t exist, KiCad will create it automatically.

Step 3: Select Layers to Plot

On the left side of the dialog, select the layers you need for your board. For a standard 2-layer PCB, select:

Layer NamePurpose
F.CuFront (Top) Copper
B.CuBack (Bottom) Copper
F.PasteFront Paste Mask (for stencils)
B.PasteBack Paste Mask (for stencils)
F.SilkscreenFront Silkscreen/Legend
B.SilkscreenBack Silkscreen/Legend
F.MaskFront Solder Mask
B.MaskBack Solder Mask
Edge.CutsBoard Outline

For multilayer boards, also include your inner copper layers (In1.Cu, In2.Cu, etc.).

Step 4: Configure General Options

Under General Options, configure these settings:

OptionRecommended SettingExplanation
Plot reference designatorsCheckedShows component labels on silkscreen
Plot footprint valuesOptionalShows component values on silkscreen
Plot footprint textCheckedIncludes all footprint text
Check zone fills before plottingCheckedPrevents outdated zone fills
Tent viasAs neededCovers vias with solder mask
Subtract soldermask from silkscreenCheckedPrevents silkscreen on pads

Step 5: Enable Gerber X2 Format

This is the critical step for generating X2 files. Under Gerber Options, find and check Use extended X2 format (recommended). This single checkbox transforms your output from standard RS-274X to intelligent Gerber X2.

Additional Gerber Options to configure:

OptionRecommended SettingNotes
Coordinate format4.6, unit mmHigher precision, standard choice
Use Protel filename extensionsManufacturer dependentMany fabs prefer this
Generate Gerber job fileCheckedCreates .gbrjob linking all files
Include netlist attributesOptionalAdds net info for advanced CAM
Disable aperture macrosUsually uncheckedOnly check if fab has compatibility issues

Step 6: Click Plot

With all settings configured, click the Plot button. KiCad will generate Gerber files for each selected layer and save them to your specified output folder. Check the Output Messages panel to confirm successful generation.

Step 7: Generate Drill Files

Don’t close the Plot dialog yet. Click Generate Drill Files… to open the drill file configuration. This is essential, as boards without drill files have no holes.

Configure drill settings:

SettingRecommended Value
Drill File FormatExcellon
Drill UnitsMillimeters
Zeros FormatDecimal format
Drill OriginDrill/place file origin
PTH and NPTH in single fileManufacturer preference
Map File FormatGerber X2 (if fab supports)

Click Generate Drill File to create your drill files.

Step 8: Generate the Gerber Job File

If you checked “Generate Gerber job file” in Step 5, KiCad automatically creates a .gbrjob file. This JSON-formatted file links all your Gerber and drill files together and contains stack-up information. It’s part of the X2 ecosystem and helps CAM software automatically identify and order your layers correctly.

Understanding the Generated Files

After export, your output folder will contain several files. Here’s what each file type represents:

File ExtensionContentX2 Enhanced
.gbr or .GTL/.GBLGerber layer filesYes, contains attributes
.gbrjobJob file linking all layersYes, X2 specific
.drl or .xlnExcellon drill filesNo (different format)
.gm1 or .GKOBoard outlineYes, contains attributes

Sample Gerber X2 File Header

When you open a Gerber X2 file in a text editor, you’ll see the attributes at the beginning:

G04 EAGLE Gerber X2 extended, *%TF.GenerationSoftware,KiCad,Pcbnew,7.0.0*%%TF.CreationDate,2024-01-15T10:30:00+00:00*%%TF.ProjectId,MyProject,12345678-9abc-def0*%%TF.FileFunction,Copper,L1,Top*%%TF.FilePolarity,Positive*%

These TF (Template File) commands are what make X2 “intelligent.”

When to Use (or Not Use) Gerber X2 in KiCad

While X2 is generally recommended, there are situations where you might need to disable it.

Use Gerber X2 When:

  • Your manufacturer supports modern CAM software
  • You want reduced risk of layer misinterpretation
  • You’re using advanced features like blind/buried vias
  • You want automated layer identification at the fab

Consider Disabling X2 When:

  • Your manufacturer explicitly requests standard RS-274X
  • You’re experiencing compatibility issues with specific fab houses
  • Using very old CAM software (some versions of CAM350 have known issues)
  • The fab house asks you to disable “extended attributes”

Verifying Your Gerber X2 Files Before Submission

Never submit manufacturing files without verification. KiCad includes a built-in viewer, and several free external tools can help.

Using KiCad’s GerbView

Launch GerbView from the KiCad main window or go to File → Open → Gerber Viewer within the PCB Editor. GerbView can:

  • Load and display all Gerber layers simultaneously
  • Read .gbrjob files to auto-load all associated files
  • Identify X2 attributes and display layer functions
  • Measure distances between features
  • Display D-codes and aperture information

Verification Checklist

Before sending files to your manufacturer, verify:

  • All copper layers are present and correctly ordered
  • Solder mask openings align with pads
  • Silkscreen doesn’t overlap pads or vias
  • Board outline is closed and complete
  • Drill holes align with pad centers
  • All reference designators are visible and readable
  • No unexpected artifacts or missing features
  • File count matches expected layer count

Free External Gerber Viewers

ToolPlatformX2 SupportKey Features
KiCad GerbViewAllYesReads .gbrjob, measures clearances
HQDFM (NextPCB)OnlineYesDFM analysis, auto layer detection
GerbvLinux/WindowsPartialOpen source, lightweight
ZofzPCBWindowsYes3D visualization
Reference Gerber ViewerAllFullOfficial Ucamco viewer

Troubleshooting Common Gerber X2 Issues in KiCad

Even experienced designers encounter problems occasionally. Here are solutions to the most common issues.

Manufacturer Reports “Unsupported Format”

Some older CAM systems can’t parse X2 attributes correctly. Solution: Uncheck “Use extended X2 format” and regenerate files. The resulting RS-274X files will work universally.

Missing or Incorrect Layer Function

If GerbView shows incorrect layer types, verify you selected the correct layers in the Plot dialog. KiCad determines the FileFunction attribute based on which layer you’re plotting.

Aperture Macro Errors

Some manufacturers report errors with complex pad shapes. Solution: Check “Disable aperture macros (not recommended)” in the Gerber Options. This converts complex shapes to primitives, which is less efficient but more compatible.

Drill Files Not Aligning

Ensure your drill files use the same origin as your Gerber files. In the drill dialog, set “Drill Origin” to match your Gerber coordinate settings.

Zone Fills Look Wrong

If copper pours appear outdated, you likely forgot to refill zones before export. Close the Plot dialog, press B to refill all zones, then regenerate all files.

Resources for KiCad Users

Here are valuable resources to help with Gerber generation and PCB manufacturing:

Official Documentation

Free Tools

Manufacturer Resources

  • JLCPCB Help Center: Detailed KiCad export guides for all versions
  • PCBWay Help Center: Step-by-step tutorials with screenshots
  • OSH Park Docs: KiCad-specific guidance for their services

Community Support

  • KiCad Forums: forum.kicad.info – Active community for troubleshooting
  • KiCad Subreddit: r/KiCad on Reddit

Frequently Asked Questions

Should I always use Gerber X2 format in KiCad?

For most modern manufacturers, yes. X2 provides better layer identification and reduces errors. However, if your fab house specifically requests standard RS-274X or you experience compatibility issues, you can disable X2 by unchecking “Use extended X2 format” in the Gerber Options.

What is the .gbrjob file and do I need to include it?

The .gbrjob file is a Gerber Job file that links all your Gerber and drill files together in a single JSON document. It contains layer stack-up information and file relationships. Including it helps CAM software automatically identify layers. Most manufacturers appreciate receiving it, but check with your fab house.

Why does my manufacturer ask me to disable X2 attributes?

Some older CAM software, particularly certain versions of CAM350, has trouble parsing X2 attributes. If your manufacturer requests “no extended attributes” or reports file errors, simply uncheck “Use extended X2 format” in KiCad’s Plot dialog and regenerate your files.

Can I generate drill files in Gerber X2 format instead of Excellon?

Yes, KiCad supports generating drill files in Gerber X2 format (select “Gerber X2” in the Map File Format dropdown). However, Excellon remains the most widely accepted drill file format. Check with your manufacturer before using Gerber-format drill files.

How do I know if my Gerber X2 files are correct?

Use KiCad’s built-in GerbView or an external viewer to inspect your files. Load all layers and check that copper, mask, and silkscreen align correctly. Verify drill holes center on pads. Look for any missing features or unexpected artifacts. The .gbrjob file can be opened in GerbView to auto-load all files in the correct order.

Best Practices for Production-Ready Gerber X2 Files

Based on experience with dozens of manufacturing runs, here are practices that consistently produce error-free results:

Establish a Standard Workflow

Create a checklist for every project that includes running DRC, refilling zones, verifying the board outline, and using consistent naming conventions. This consistency prevents the “I forgot to check one thing” errors that delay manufacturing.

Communicate with Your Manufacturer

Before your first order with a new fab house, ask about their preferred file formats and any specific requirements. Some manufacturers have strong preferences about X2 versus RS-274X, file naming conventions, or whether to merge plated and non-plated drill files.

Archive Your Manufacturing Files

Always save a copy of the exact files you submitted for manufacturing, along with the date and manufacturer information. If issues arise during fabrication or you need to reorder boards months later, having the original files prevents confusion about which version was actually manufactured.

Conclusion

Generating Gerber X2 files in KiCad is straightforward once you understand the process and settings. The single checkbox for enabling X2 format gives you access to intelligent manufacturing data that reduces errors and improves communication with your fabricator. The key is ensuring you’ve properly prepared your design (DRC, zone fills, board outline), selected the right layers, and verified your output before submission.

KiCad’s export capabilities have matured significantly, and the built-in GerbView tool makes verification easy. Whether you’re a hobbyist ordering from budget fab houses or a professional engineer working with high-reliability manufacturers, the X2 format offers tangible benefits with zero downside risk since it’s backward compatible.

Take the time to verify your files before every order. A few minutes spent checking your Gerbers can save days of manufacturing delays and prevent costly board respins. And remember, if you encounter compatibility issues with a specific manufacturer, you can always fall back to standard RS-274X by unchecking one box. That flexibility is one of the many reasons KiCad has become the tool of choice for so many PCB designers.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Sales & After-Sales Service

Contact & Quotation

  • Inquire: Call 0086-755-23203480, or reach out via the form below/your sales contact to discuss our design, manufacturing, and assembly capabilities.

  • Quote: Email your PCB files to Sales@pcbsync.com (Preferred for large files) or submit online. We will contact you promptly. Please ensure your email is correct.

Drag & Drop Files, Choose Files to Upload You can upload up to 3 files.

Notes:
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. For PCB assembly, we require PCB design file in above mentioned format, drilling file and BOM. Click to download BOM template To avoid file missing, please include all files into one folder and compress it into .zip or .rar format.