Gerber X2

Gerber X2 was introduced in the fall of 2013. Gerber X2 supports attributes but is compatible with X1. Attributes are akin to labels providing information associated with the image or features in it. X2 defines a set of attributes to streamline the transfer of fabrication data from design to fabrication. The most important new attributes are:

  • File function: Is the file the top solder mask or the bottom copper layer, etc.?
  • File polarity: Is the file positive or negative
  • Part: Does the file represent a single PCB, an array, a coupon, etc.?
  • Pad function: Is the flash an SMD pad, a via pad, or a fiducial, etc.?

Attributes are superfluous when only the image is needed, but are invaluable when PCB data is transferred from design to fabrication. The PCB fabricator needs more than the image alone: for example, to fabricate the solder mask he needs to know what are vias and what are component pads. The attributes transfer this information in an unequivocal and standardized manner. They convey the design intent from CAD to CAM. This is sometimes rather grandly called “adding intelligence to the image”. Without attributes, the fabricator must reverse engineer the designer's intention,  a time-consuming and error-prone process.

X2 allows the designer to transfer the full design information to fabrication in a formal, standard and machine-readable way. Always send X2 to fabrication if your CAD system can generate it. It is so much safer.

Introduction to Gerber X2

Frequently asked questions (FAQ)

What is new in Gerber X2?

Gerber X2 has adds four new commands (TF, TA, TO and TD) to attach attributes to a Gerber file.  All pre-existing commands remain unchanged. Furthermore Gerber X2 defines a range of standard attributes to streamline the transfer of PCB designs from CAD to fabrication. The new commands do not affect the image. If they are ignored the correct image is generated.  Thus X2 is compatible with X1.

What are the benefits of Gerber X2?

In X2 you specify your PCB design in a standardized and machine readable way,  rather than relying on manual work and reverse engineering. X2 slashes the risk of wrong interpretations,  with the resulting scrap. It avoids the risk that the fabricator must contact the designer to find out missing information, with the resulting delay.  

X2 improves your chances to receive your PCB on time, right first time.   X2 offers the benefit of an standardized automated workflow over an informal manual one.  In X2 you specify exactly how you want your PCB rather than relying on interpretations.

Is Gerber X2 compatible with Gerber X1?

Yes. Gerber X2 is both backward and forward compatible.

  • Backward: A Gerber X2 reader will read a Gerber X1 file perfectly. The attributes are optional, not mandatory. Therefore a valid X1 file is a valid X2 file. 
  • Forward: A compliant Gerber X1 reader will read a Gerber X2 file and generate the correct image. It may give a warning that it does not recognize the new attribute commands; these warnings can be safely ignored.

If an application chokes on Gerber X2, it is not a compliant Gerber X1.

It is very simple to convert an X2 file to an X1 file: just remove the attributes; a simple script can do it.

Gerber X1 is simple and human-readable. What about X2?

X2 remains simple and man-readable. If you understand X1 you will quickly learn X2.  See for yourself: Below is a small X2 file with the new commands highlighted. Chances are you will understand most of them without even looking at the specification.

G04 Small example Gerber X2 file*
%FSLAX35Y35*%
%MOMM*%
%TF.FileFunction,Copper,L4,Bot,Signal*%
%TF.Part,Single*%
%TA.AperFunction,Conductor*%
%ADD10C,0.15000*%
%TA.AperFunction,ViaPad*%
%ADD11C,0.75000*%
%TA.AperFunction,ComponentPad*%
%ADD12C,1.60000*%
%ADD13C,1.70000*%
%SRX1Y1I0.00000J0.00000*%
G75*
%LPD*%
D10*
X7664999Y3689998D02*
X8394995D01*
X8439999Y3734999D01*
X9369999D01*
D11*
X7664999Y3689998D03*
X8359999Y1874998D03*
X9882998Y3650498D03*
D14*
X4602988Y7841488D03* D15*
X10729976Y2062988D03*
X10983976D03*
X11237976D03*
M02*

With this extension the Gerber file maintains its key benefit of being simple and human readable.

Do I send X1 or X2 files to my fabricator?

Always send X2 files if your CAD software allows it.  In X2 you specify exactly how you want your PCB rather than relying on interpretations by an operator.

If your fabricator’s software takes advantage of X2 you have better chances to get your PCB as you want, first time right, hassle-free.

If your fabricator’s software does not, there is nothing gained but nothing lost by sending X2: compliant Gerber software simply ignores the new attributes and reads the X1 image as before.

Anyhow, X2 is the new revision since Q1 2014, and you are not going to use an old version forever, are you? And if some of your fabricators does not go with the times, and refuses X2 jobs, so be it, but don’t withhold yourself the benefits of X2 when sending work to those that are with the times and accept X2. Furthermore, note that it is very simple to convert an X2 file to an X1 file: just remove the attributes; a simple script can do it.

Software applications supporting  the Gerber X2 file format

Ucamco GC-Prevue Altium Designer
PCB-Layout Numerical Innovations KiCad
PCB-Layout LPKF Proteus
Pulsonix Pentalogic Cuprum
TeboSoft Stella Vision Labcenter
GerbView ZofcPCB gerber2pdf
PCBWorks Macaos Gerbv
PlanetCNC Curta Circuitos LPKF
DesignSpark Compuphase CAD6
DesignSpark PCB Investigator

If you supply software that supports X2 and you wish to add it to this list please contact us at gerber@ucamco.com.

Is it difficult to implement Gerber X2?

No, it is quite straightforward. The neat thing is that the complex part of PCB data exchange – the image data – remains unchanged. Furthermore, the attributes are not mandatory, one can simply choose not to use them or, when they are used, choose to ignore them.  It is also OK to implement just the easiest attributes. Of course, as the attributes convey important meta-information, the more complete attributes, the better.

When outputting a PCB layer the software ‘knows’ which layer it is, so it is quite straightforward to add a line in the header that defines that layer. Implementing the pad attributes is subtler but still not rocket science.

Input is rather simpler. Even a legacy X1 reader will read the image correctly, maybe throwing a warning that can safely be ignored.  A minimal implementation just detects the new commands and suppresses the warnings. Hardly a big task.  Of course, then no benefits are reaped from the attributes.  A full implementation of X2 takes a more work but will derive maximum advantage from the wealth of information conveyed by the attributes.

Will my software vendor support X2?

The answer depends on what you exactly mean by ‘support X2’.

If you mean reading and writing X2 files, then any compliant Gerber software supports X2 – X1 and X2 are compatible.  (If your software would not handle X2 files properly then it is not even compliant with X1 Gerber, a quite serious issue indeed.)

If you mean taking advantage of the rich information contained in the X2 attributes it requires development. This is quite straightforward, but the more attributes are used, the more work it takes. When your software will take advantage of attributes is for your software vendor to state.

That said Gerber X2 is today's Gerber.  Eventually, not supporting attributes is abandoning Gerber support altogether. Of course, vendors need a reasonable time to implement the attributes. What is a reasonable time? We must leave this to your judgment.  The final specification of X2 was released in 2014 Q1. The clock is ticking since 2014 Q1.

Is X2 a new format or is it still Gerber?

X2 is Gerber.  X2 is a concise way of saying “Gerber with attributes”, or more specifically “Extended Gerber with attributes”. An X2 file contains attributes.  And X1 file does not. Both are extended Gerber files.

X2 is simply a new version of extended Gerber. It has also been called Gerber version 2. As X2 is compatible this does not make it a new format. PDF evolved from version 1.1 to version 1.7; it never stopped being PDF. ODB++ is now at version 8; it's still ODB+.

Supporting PDF means, today, supporting PDF 1.7. If you use legacy software that does only support PDF 1.5, your state you support PDF, but only till version 1.5, not unqualified PDF. Well, supporting Gerber today means supporting extended Gerber files with attributes, or X2 files. Point. That does not mean that you must use all the information conveyed by the attributes; it is OK simply to skip them; OK, but not ideal.

What do the different names for the Gerber format mean?

The Gerber Format, unqualified, obviously means what is described the current Gerber specification, not in older versions. Attributes are a new feature introduced in the specification in 2014 Q1. As attributes convey a new type of information, not image information, adding them was a qualitative leap in capability; it was called the second extension and people identified the new version as X2; quite handy. Therefore X2 files are Gerber files. So are X1 files.

Standard Gerber is now an obsolete and revoked format. Extended Gerber is not compatible with Standard Gerber. As Standard Gerber no longer conforms to the specification, it can no longer be called Gerber, unqualified. It should be referred to using its full name (Standard Gerber). Anyhow, do not use Standard Gerber any longer!

Extended Gerber, Gerber X and RS-274X are historic names that distinguished newer versions from Standard Gerber. As Standard Gerber is revoked and rarely used these names are no longer very helpful and are maybe better abandoned. If used, it includes both X1 and X2.

In other words:

  • Standard Gerber is not Gerber
  • Extended Gerber is the same as Gerber
  • Gerber X1 is a subset of Extended Gerber
  • Gerber X2 is a subset of Extended Gerber

X2 is new, will implementations not be very buggy?

No, the quality is good. Well, it is not that new. The specification was released in 2014 Q1, and discussions started much earlier. Most implementations are field tested.

More importantly, the really difficult part in any CAD/CAM software is the geometric software. Furthermore, errors in the image are fiendishly hard to see and can easily lead to scrap. The neat thing about X2 is that the geometric part is exactly the same as in good old and thoroughly debugged X1. New are the attributes, and these are quite straightforward. Furthermore, errors in the attributes are easy to detect. For example, if an attribute in a legend would say it is a drill file, the fabricator will notice there is something wrong!

Lastly, Ucamco and  CAD vendors that implemented X2 output have closely cooperated to get it right. The final X2 output samples were certified by Ucamco to comply fully with the spec.

Link to web site of Eurocircuits

The benefits of the Gerber X2 format

Find out why Eurocircuits states that Gerber X2 is todays standard and why you should use it

Link to the Eurocircuits blog page

Link to web site of Eurocircuits

Quote from Bryce Nesbitt from Stemminnovation

Gerber X2 is so easy to implement.
Support is growing fast!

Link to web site of Bay Area Circuits

Advantages of the Gerber X2 format
By Peter Brissette from Bay Area Circuits

A new Gerber format was released call Gerber X2 (or version 2) by Ucamco, owners of the Gerber standard. If this is news to you, Ucamco has put together an excellent 5 minute intro video

Read the full blog post

Latest news about Gerber Format