.KICAD_MOD File Format

KiCad footprint

Introduction

A .kicad_mod file holds one footprint for KiCad: the copper pads, outlines and text that a component needs on a circuit board. A footprint library is a folder of these files. The text is UTF-8 in the S-expression syntax of KiCad board files, and the format dates from KiCad 4.0. This page follows what the KiCad 10.0 program writes (format version 20260206), notes where 9.0 (20241229) differs, and lists the older forms the 10.0 reader accepts. The items that fill a footprint are on three further pages: pads, graphics and text, and zones and groups.

File structure

(footprint "NAME"
  (version 20260206)
  (generator "pcbnew")
  (generator_version "10.0")
  [(locked yes)] [(placed yes)]
  (layer "F.Cu")
  [(descr "…")] [(tags "…")]
  (property "NAME" "VALUE" …) …
  [(component_classes (class "…") …)]
  [(property ki_fp_filters "…")]
  [(sheetname "…")] [(sheetfile "…")]
  [(units (unit (name "A") (pins "1" "2" …)) …)]
  [(solder_mask_margin M)] [(solder_paste_margin M)]
  [(solder_paste_margin_ratio R)] [(clearance C)] [(zone_connect N)]
  [(attr FLAG …)]
  [(stackup (layer "NAME") …)]
  [(private_layers "…" …)]
  [(net_tie_pad_groups "…" …)]
  (duplicate_pad_numbers_are_jumpers yes|no)
  [(jumper_pad_groups ("1" "2" …) …)]
  [graphics and text …]
  [(point …) …]
  [(pad …) …]
  [(zone …) …]
  [(group …) …]
  [(variant …) …]
  (embedded_fonts yes|no)
  [(embedded_files …)]
  [(model …) …])

Square brackets mark optional parts; they are not in the file. This is the order the program writes. The version comes first because it controls how later items are read. Compared with a footprint placed on a board, a library file has the bare name without a library prefix, carries its own version and generator, and leaves out the footprint's position (at), its own uuid, its schematic path and pad nets, pin functions and pin types. Other programs are asked not to name themselves pcbnew as generator.

  • Lengths are in millimetres and angles in degrees. Coordinates are relative to the footprint's origin.
  • Comment lines may stand before the opening bracket; the program keeps them.
  • A file with a version newer than the program knows is reported as made by a newer version.
  • Layer names are the untranslated names such as F.Cu, F.SilkS and F.CrtYd; user layers are User.1 onwards and inner copper In1.Cu onwards.

Fields

(property "NAME" "VALUE"
  [(locked yes)]
  (at X Y [ANGLE]) [(unlocked yes)]
  (layer "NAME" [knockout])
  [(hide yes)]
  (uuid "…")
  (effects …)
  [(render_cache …)])

Fields such as Reference, Value, Datasheet and Description and any added by the user are text items; the parts after the value are those of text. A property with the name of an existing field sets that field. A new user field with no layer goes on F.Fab or B.Fab. A property called Footprint is read and discarded.

Local settings

  • solder_mask_margin, solder_paste_margin, solder_paste_margin_ratio and clearance override the board rules for this footprint; absent means inherited. In files of version 20240201 or earlier, zero also meant inherited.
  • zone_connect: 0 no connection, 1 thermal reliefs, 2 solid, 3 thermal reliefs for through-hole pads only.
  • stackup is written only when the footprint defines its own layer set instead of stretching to the board's inner layers (version 20250818). It lists the layers; the copper layers must be an even number without gaps, and other technical layers are not allowed.
  • private_layers names layers whose contents show only in the footprint editor. In files older than 20220427, Edge.Cuts and Margin are removed from the list.
  • Each string in net_tie_pad_groups is a comma-separated list of pads that are allowed to short different nets together.
  • duplicate_pad_numbers_are_jumpers and jumper_pad_groups declare pads that are connected inside the part (version 20250324).

Attributes

attr is a list of flags.

FlagMeaning
smdsurface-mounted part
through_holethrough-hole part
board_onlyhas no symbol in the schematic
exclude_from_pos_filesleft out of placement files
exclude_from_bomleft out of the bill of materials
allow_missing_courtyardno courtyard is required
dnpdo not populate
allow_soldermask_bridgesmask openings may join pads

Variants

(variant (name "NAME")
  [(dnp yes|no)] [(exclude_from_bom yes|no)] [(exclude_from_pos_files yes|no)]
  [(field (name "Value") (value "100nF")) …])

KiCad 10.0 stores assembly variants (version 20260101). Only settings and field values that differ from the footprint's own are written. A variant without a name, or a field with an empty name, is ignored.

3D models

(model "FILE"
  [(hide yes)] [(opacity N)]
  (offset (xyz X Y Z))
  (scale (xyz X Y Z))
  (rotate (xyz X Y Z)))

The file name may use path variables. offset is in millimetres. The older at list, replaced by offset in 2017 (versions 20171114 and 20171130), is always read as inches.

Embedded files and fonts

(embedded_fonts yes|no)
(embedded_files
  (file (name "NAME")
    (type datasheet|font|model|worksheet|other)
    [(data |BASE64
      BASE64|)]
    (checksum "HASH")) …)
  • The data is the file compressed with Zstandard and encoded as Base64 in lines of 76 characters, with a | before the first and after the last. The bar is a token of its own from version 20240706.
  • The checksum is a MurmurHash3 of the uncompressed file; a 64-character value is checked as SHA-256.
  • A footprint inside a board is written without the data. An empty data list, which KiCad 9.0.0 could write by mistake, is accepted. Errors in this block only cause a warning when a footprint is read.

Versions

The version numbers are those of the board format; the board page groups them by KiCad release. Changes that matter for footprint files:

VersionChange
20171114, 201711303D model offset saved in millimetres; written as offset
20190331, 20190421, 20190907Chamfered rounded pads; curves in custom pads; rule areas in footprints
20191123, 20200104Pad pin function; pad properties
20200724, 20200808, 20200809Footprint identifiers; footprint properties; removal of unused pad layers
20200828, 20200829New fabrication attributes; library name removed from exported footprints
20201002, 20201115, 20201116Groups in footprints; root module renamed footprint and new fill syntax; version and generator in footprint files
20211014, 20211227, 20211228Three-point arcs; thermal spoke angle; allow_soldermask_bridges
20211229, 20211230, 20211231, 20211232stroke; dimensions in footprints; private layers; fonts
20220131, 20220225, 20220308Text boxes; tedit removed; knockout and locked text
20220621, 20220818, 20221018Images; net ties; zone layer connections
20230410, 20230517, 20230620Do-not-populate flag; teardrop settings; fields as properties
20231212, 20231231, 20240108Yes/no booleans; uuid replaces id; teardrop booleans
20240201, 20240202, 20240609Overrides may be absent; tables; tenting
20240706, 20240928, 20240929Embedded files; component classes; complex padstacks
20250222, 20250324, 20250811Hatched shapes; jumper pads; press-fit property
20250818, 20250829, 20250901Custom layer sets; rounded rectangles; points
20250909, 20250914, 20250926, 20251027Footprint units; barcodes; via type changes; die delay scaling
20251028, 20251101, 20260101, 20260206Net codes no longer written; backdrill; variants; barcode and variant attributes

Older forms

  • (module …) as the root, from before version 20201115, often with unquoted strings.
  • tstamp for uuid; tedit, autoplace_cost90, autoplace_cost180 and footprint-level thermal_width and thermal_gap are read and ignored.
  • solder_paste_ratio for solder_paste_margin_ratio.
  • attr virtual, from before version 20200826, means both exclude_from_pos_files and exclude_from_bom. In those files a footprint whose attr gives no type and none of virtual, board_only, exclude_from_pos_files, exclude_from_bom and dnp is taken as through-hole.
  • In files of version 20220815 or earlier, a footprint whose tags begin with net tie becomes a net tie joining all its pads.
  • Before version 20230620, properties were plain name and value pairs. ki_keywords and ki_locked are skipped, ki_description fills the Description field, Sheetname or Sheet name and Sheetfile or Sheet file set the sheet items, and other fields are hidden. Reference and value were then fp_text items.
  • Booleans such as locked and placed may be a bare word or a list without a value, both meaning yes; true and false are accepted as well as yes and no.
  • In layers lists, the names Inner1.Cu to Inner14.Cu of the first S-expression files are read as In14.Cu down to In1.Cu.

Divergence from spec

The KiCad developer documentation gives the header as footprint, version and generator and covers KiCad 6.0 onwards. The 10.0 program also writes generator_version, embedded_fonts, jumper settings and, where used, units, variants, a footprint stackup, embedded files and component classes.

KiCad 9.0 and 10.0

  • 9.0 writes version 20241229, 10.0 version 20260206.
  • 9.0 numbers nets: (net CODE "NAME") on pads, (net CODE) on shapes, and (net CODE) (net_name "NAME") on zones.
  • 9.0 writes tenting as bare words and always writes (filled_areas_thickness no) on zones.
  • 9.0 tables have no uuid.
  • New in 10.0 for the footprint as a whole: points, barcodes, variants, units, a footprint stackup and the two jumper pad items.
  • New in 10.0 for drawing items and zones: rounded rectangles, hatched shape fills, knockout on text boxes, a lib_id on groups, a group as placement source and per-layer zone properties. 9.0 also writes no locked on a field.
  • New in 10.0 for pads: backdrill and tertiary drill, post-machining, die delay and the press-fit property.

Reading the file

  • A footprint file begins (footprint followed by the name. Files from before KiCad 6 begin (module, may have no version, and quote strings only where needed.
  • Read the whole file as one S-expression; line breaks and indentation carry no meaning.
  • The older .mod libraries of KiCad are a different, line-based format.

In the explorer

A dropped .kicad_mod file shows its lists as a byte tree and a drawing of the footprint: graphic items, texts, fields, text boxes, tables, dimensions, points, barcodes, zones and pads with their holes and numbers. Options choose the layers and the size of the picture. A click in the picture selects the bytes of the item. Tables list the pads, graphic items, fields, zones, groups, 3D model locations and the values of a footprint stack-up. PNG and JPEG images are painted in the drawing. Embedded files and images open as files of their own, and the checksum of each embedded file is compared with its data.

Solder mask and paste layers show pads with the margins the footprint sets. A layer choice picks the matching padstack entry of a pad; with all copper layers shown, the other entries are outlined in their layer’s colour. Backdrills and post-machining are marked in the colours of the layers they reach, and zone outlines carry their edge or full hatching.

Files up to 400 MB are read. At most 2,000,000 points where zone hatch lines meet an outline are worked out for one zone.

Not described

The development branch after KiCad 10.0 may write newer versions; this page covers the 9.0 and 10.0 releases.

Known, not yet covered

  • Viewer: text without a stored outline is drawn in the site’s own stick font, not in KiCad’s fonts. The stick font has ASCII, accented Latin letters and some common signs; other characters show as boxes.
  • Viewer: barcodes are encoded by the viewer, so their modules can differ from KiCad’s for the same text; Data Matrix uses its ASCII scheme only and so can come out larger.
  • Viewer: images other than PNG and JPEG are drawn as crossed frames.
  • Viewer: the text of text boxes and table cells in a rotated or flipped footprint is not always placed inside its box.
  • Viewer: hatched fills of graphic shapes use the viewer’s own spacing, and dimension arrows and extensions are simplified.
  • Viewer: pads are drawn on every layer they name, also where the footprint asks for unused copper to be removed.

Links

Software

  • KiCad – free electronics design suite (Windows, macOS, Linux)

Developers

  • KiCad source code – the footprint reader and writer are in pcbnew/pcb_io/kicad_sexpr (C++, GPL)

Reference