Skip to main content

Overview

KiCad uses S-expression (symbolic expression) based file formats for all native files. This provides:
  • Human-readable text format
  • Version control friendly (meaningful diffs)
  • Extensible structure
  • Forward and backward compatibility
  • Fast parsing performance

S-Expression Format

Syntax

S-expressions are nested lists enclosed in parentheses:

Parser

Implementation: libs/sexpr/ Features:
  • Recursive descent parsing
  • Streaming support for large files
  • Line number tracking for errors
  • UTF-8 support
Example:

Native File Formats

Schematic Files (.kicad_sch)

Purpose: Store schematic design data Structure:
Key sections:
  • Header: Version, generator, UUID
  • Page setup: Paper size, title block
  • Symbol libraries: Embedded symbol definitions
  • Instances: Placed symbols with properties
  • Wiring: Net connections
  • Annotations: Text, labels, notes
  • Hierarchical sheets: Sub-schematics
Properties:
  • Reference - Component reference (R1, C5, etc.)
  • Value - Component value
  • Footprint - Associated PCB footprint
  • Datasheet - Documentation URL
  • Custom fields - User-defined properties

PCB Files (.kicad_pcb)

Purpose: Store printed circuit board layout Structure:
Key sections:
  • Header: Version, generator
  • General: Board properties (thickness, etc.)
  • Layers: Layer stack definition
  • Setup: Manufacturing parameters
  • Nets: Electrical connectivity
  • Footprints: Component placements
  • Tracks/Vias: Copper routing
  • Zones: Copper pours
  • Drawings: Silkscreen, fabrication layers

Symbol Libraries (.kicad_sym)

Purpose: Reusable schematic symbol definitions Structure:
Symbol units:
  • _0_1 - Graphical representation (body)
  • _1_1 - First unit pins
  • _2_1 - Second unit pins (for multi-unit symbols)
Pin types:
  • input - Input pin
  • output - Output pin
  • bidirectional - Bidirectional I/O
  • tri_state - Tri-state output
  • passive - Passive component
  • power_in - Power input
  • power_out - Power output
  • open_collector - Open collector
  • open_emitter - Open emitter
  • unspecified - Unspecified

Footprint Libraries (.kicad_mod)

Purpose: PCB footprint definitions Structure:
Layers:
  • F.Cu/B.Cu: Copper (front/back)
  • F.SilkS/B.SilkS: Silkscreen
  • F.Mask/B.Mask: Solder mask
  • F.Paste/B.Paste: Solder paste (stencil)
  • F.Fab/B.Fab: Fabrication layer
  • Dwgs.User: User drawings
  • Cmts.User: Comments
  • Edge.Cuts: Board outline
Pad types:
  • thru_hole - Plated through-hole
  • smd - Surface mount
  • connect - Connection point (no copper)
  • np_thru_hole - Non-plated hole
Pad shapes:
  • circle - Circular
  • rect - Rectangular
  • oval - Oval
  • trapezoid - Trapezoidal
  • roundrect - Rounded rectangle
  • custom - Custom shape polygon

Project Files (.kicad_pro)

Purpose: Project settings and metadata Format: JSON (exception to S-expression) Structure:

Library Tables

Symbol Library Table (sym-lib-table)

Purpose: Define symbol library locations Format: S-expression
Scope:
  • Global: ~/.config/kicad/8.0/sym-lib-table
  • Project: project/sym-lib-table

Footprint Library Table (fp-lib-table)

Purpose: Define footprint library locations
Library types:
  • KiCad - Native .pretty directories
  • GitHub - Remote GitHub repositories
  • Legacy - Old .mod format

Auxiliary File Formats

Design Rules (*.kicad_dru)

Purpose: Custom design rule definitions Format: S-expression

Worksheets (.kicad_wks)

Purpose: Drawing sheet/title block templates Format: S-expression Elements:
  • Lines, rectangles, polygons
  • Text with variable substitution
  • Images/logos
  • Page numbering

3D Model Files

Supported formats:
  • STEP (.step, .stp) - Industry standard CAD
  • VRML (.wrl) - 3D mesh format
  • X3D (.x3d) - XML-based 3D
Model locations:
  • Environment variable: ${KICAD8_3DMODEL_DIR}
  • Project relative: ${KIPRJMOD}/3d_models/

Export Formats

Manufacturing Outputs

Gerber (RS-274X)

Extension: .gbr, .gtl, .gbl, etc. Layers:
  • .gtl - Top copper (F.Cu)
  • .gbl - Bottom copper (B.Cu)
  • .gto - Top silkscreen (F.SilkS)
  • .gbo - Bottom silkscreen (B.SilkS)
  • .gts - Top solder mask (F.Mask)
  • .gbs - Bottom solder mask (B.Mask)
  • .gm1 - Board outline (Edge.Cuts)
Drill files:
  • Excellon format (.drl)
  • Separate PTH/NPTH or merged

Pick-and-Place

Extension: .pos Format: CSV

Bill of Materials (BOM)

Extension: .csv, .xml Formats:
  • CSV - Simple tabular
  • XML - Structured data
  • Custom via BOM plugins

Documentation

PDF

Purpose: Printable schematics and PCB layouts Features:
  • Vector graphics
  • Embedded fonts
  • Color/monochrome
  • Layer selection

SVG

Purpose: Web-friendly vector graphics Use cases:
  • Documentation websites
  • Interactive viewers
  • Editing in vector tools

CAD Exchange

DXF (Drawing Exchange Format)

Purpose: Mechanical CAD integration Exported data:
  • Board outline
  • Component outlines
  • Mounting holes
  • Keepout zones

STEP (.step)

Purpose: 3D mechanical model Content:
  • Board substrate
  • Component 3D models
  • Accurate positioning
  • Assembly validation

IDF (Intermediate Data Format)

Purpose: MCAD ↔ ECAD exchange Files:
  • .emn - Board outline and components
  • .emp - Component library
Versions: IDF 2.0, 3.0, 4.0

File Format Versioning

Version Field

All KiCad files include version number:

Compatibility

Forward compatibility: Newer KiCad versions can open older files Backward compatibility: Limited - older versions may not understand new features Migration: Automatic format upgrade on save

Version History

  • 20250610: KiCad 9.0 development
  • 20231231: KiCad 8.0 release
  • 20230620: KiCad 7.0 release
  • 20211014: KiCad 6.0 release
  • 20200825: KiCad 5.99 (development)

File Encoding

Character encoding: UTF-8 (mandatory) Line endings:
  • Unix: LF (\n)
  • Windows: CRLF (\r\n) - normalized to LF
  • macOS: LF (\n)
Whitespace: Flexible (spaces/tabs for formatting)

File Compression

Native files are not compressed to ensure:
  • Version control efficiency (meaningful diffs)
  • Text editor compatibility
  • Debugging capability
  • Cross-platform portability
For archival, use standard compression (ZIP, tar.gz).

See Also