Overview
Manufacturing output is handled by various exporter classes in KiCad. The most important are Gerber generation (source/pcbnew/exporters/gerber_jobfile_writer.h), drill file generation, and assembly file creation.Gerber Files
What are Gerber Files?
Gerber files are the industry standard format for PCB manufacturing. Each file represents one layer of the PCB:Copper Layers
Front, back, and internal copper patterns
Solder Mask
Protective coating over copper
Silkscreen
Component designators and markings
Paste Stencil
Solder paste application pattern
Generating Gerber Files
1
Open Plot Dialog
In Pcbnew: File → Fabrication Outputs → Gerbers (.gbr)
2
Select Layers
Choose which layers to export:Standard 2-layer board:
- F.Cu (front copper)
- B.Cu (back copper)
- F.SilkS (front silkscreen)
- B.SilkS (back silkscreen)
- F.Mask (front solder mask)
- B.Mask (back solder mask)
- F.Paste (front solder paste, SMD only)
- B.Paste (back solder paste, SMD only)
- Edge.Cuts (board outline)
3
Configure Options
Set Gerber parameters:Coordinate format: 4.6 (millimeters) or 4.5 (recommended)Aperture macros: Use for complex pad shapes
4
Generate Files
Click Plot to create Gerber files.Output files:
5
Generate Gerber Job File
Create a Gerber job file (JSON format) describing the fabrication:The job file includes:
- List of Gerber files and their layer assignments
- Board dimensions
- Layer stackup (copper/dielectric thickness)
- Material specifications
- Manufacturing notes
Gerber File Structure
Gerber files use RS-274X format:Drill Files
NC Drill Files
Generate drill files for through-holes and vias:1
Open Drill File Dialog
File → Fabrication Outputs → Drill Files (.drl)
2
Select Format
Choose drill file format:
- Excellon
- Gerber X2
Most common format (NC Drill)Settings:
- Units: Millimeters (recommended) or inches
- Zeros: Decimal format (3.3) or suppress leading/trailing
- Precision: 3:3 (mm) or 2:4 (inch)
3
Configure Drill Options
Set drill parameters:
- PTH and NPTH in single file: Combine all holes
- Separate files: PTH drills separate from NPTH
- Merge PTH and NPTH: All holes together (not recommended)
- Drill origin: Absolute or auxiliary axis
4
Generate Drill Map
Create visual drill map (PDF or Gerber) for reference.Shows:
- Drill hole positions
- Tool numbers and sizes
- Layer information
5
Generate Files
Output files:
Drill File Structure
Excellon format example:Assembly Files
Pick-and-Place (PnP)
Generate component position files for automated assembly:1
Export Position File
File → Fabrication Outputs → Component Placement (.pos)
2
Select Format
Choose file format:
- ASCII (CSV): Human-readable, most compatible
- Gerber X3: Modern format with full metadata
3
Configure Options
Set position file parameters:
4
Filter Components
Options:
- Include only SMD: Exclude through-hole parts
- Include only with SMD attribute: Use footprint attributes
- Exclude from pos files: Honor footprint flag
- Exclude DNP: Skip Do Not Populate components
PnP File Format
CSV format example:Gerber X3 Pick-and-Place
Modern format with component metadata:Bill of Materials (BOM)
Generate BOM from Schematic
In Eeschema: Tools → Generate BOM- Built-in BOM
- BOM Plugins
Simple component list:
- Grouped by value
- Shows reference designators
- Includes quantities
- Basic CSV or XML output
BOM Content
Typical BOM includes:string
required
Component designator (R1, C5, U3)
number
required
Number of identical components
string
required
Component value or part number
string
PCB package type
string
Link to component datasheet
string
Component manufacturer
string
Manufacturer part number
string
Where to purchase (Digi-Key, Mouser, etc.)
string
Supplier part number
Other Export Formats
IPC-2581
Modern PCB fabrication format:GenCAD
Legacy CAM format:Hyperlynx
Signal integrity simulation:IDF (Intermediate Data Format)
Mechanical CAD integration:Fabrication Package
Typical fabrication package includes:Manufacturing Notes
Include fabrication notes with your order:Board Specifications
- Material: FR4, aluminum, flexible, etc.
- Thickness: 1.6mm (standard), 0.8mm, 2.0mm, etc.
- Copper weight: 1oz (35µm), 2oz, etc.
- Layers: 2, 4, 6, 8, etc.
- Finish: HASL, ENIG, OSP, etc.
- Color: Green, blue, red, black, white mask
- Min trace/space: Based on design rules
- Min drill: Smallest hole size used
Special Requirements
- Controlled impedance traces
- Blind/buried vias
- Edge plating
- Chamfered edges
- Gold fingers (edge connectors)
- Specific markings or serialization
Validation Before Manufacturing
1
Run DRC
Ensure all design rule violations are resolved.
2
Verify Gerbers
Use Gerber viewer (GerbView in KiCad) to inspect all layers:
- Check copper patterns
- Verify silkscreen placement
- Confirm solder mask openings
- Inspect board outline
3
Check Drill Files
Review drill map:
- Verify hole sizes
- Check PTH vs NPTH
- Confirm via locations
4
Review Assembly Data
Validate pick-and-place:
- Component positions correct
- Rotations accurate
- No missing components
- DNP flags set properly
5
3D Check
Use 3D viewer to verify:
- Component heights
- Mechanical clearances
- Connector orientations
- Mounting hole positions
Best Practices
Use Standard Formats
Use Standard Formats
Stick to Gerber RS-274X and Excellon drill files for maximum compatibility with manufacturers.
Include Job File
Include Job File
Always generate a Gerber job file. It helps manufacturers understand your design intent.
Check with Manufacturer
Check with Manufacturer
Verify your manufacturer’s requirements before generating files. Some have specific layer naming or format preferences.
Archive Everything
Archive Everything
Keep complete fabrication packages with design files. Include date and revision in filenames.
Test First Article
Test First Article
Order a small quantity initially to verify the design before full production.
Source Code References
Next Steps
Design Rules
Configure constraints for manufacturability
PCB Layout
Design boards for manufacturing
3D Models
Export 3D for mechanical integration