Skip to main content

Overview

KiCad uses S-expression based text formats for all design files. This makes them human-readable, version-control friendly, and easy to parse programmatically. Understanding these formats enables custom tool development and advanced automation.

File Format Philosophy

KiCad’s file formats follow these principles:
  • Human-readable: Text-based S-expressions
  • Self-documenting: Tag names describe content
  • Forward-compatible: Unknown tags are preserved
  • Hierarchical: Nested structure reflects logical relationships
  • Version-tracked: Format version in header

PCB File Format (.kicad_pcb)

File Structure

Based on /demos/cm5_minima/CM5_MINIMA_3.kicad_pcb:

Layer Definition

Layer format: (id "name" type ["display_name"])

Stackup Definition

Footprint Definition

Track and Via

Zone (Copper Pour)

Schematic File Format (.kicad_sch)

Basic Structure

Symbol Instance

Wire and Connections

Project File Format (.kicad_pro)

Parsing Files with Python

S-Expression Parser

Extract Board Information

Modifying Files

Generate Custom Footprint

Best Practices

  1. Preserve UUIDs: Never reuse or modify existing UUIDs
  2. Maintain version: Keep format version up to date
  3. Validate syntax: Ensure balanced parentheses
  4. Backup before editing: Always keep originals
  5. Use version control: Track changes with git
  6. Test incrementally: Verify file loads after each change
  7. Follow conventions: Match KiCad’s formatting style

See Also