.KICAD_MOD File Format – Pads

KiCad footprint

Introduction

A pad is a piece of copper, with or without a hole, that belongs to a footprint. The syntax is the same in footprint files and inside footprints on a board. This page covers what the KiCad 10.0 and 9.0 programs write and the older forms the 10.0 reader still accepts. Square brackets mark optional parts.

  • Lengths are in millimetres and angles in degrees.
  • The position in at is relative to the footprint. On a placed footprint the angle is the pad's total angle, including the footprint's rotation.
  • yes/no is a boolean. yes/no/none is a three-state value where none means that the setting is inherited.

Pad syntax

(pad "NUMBER" TYPE SHAPE
  (at X Y [ANGLE])
  (size W H)
  [(rect_delta DX DY)]
  [(drill [oval] [W [H]] [(offset X Y)])]
  [(backdrill (size D) (layers "START" "END"))]
  [(tertiary_drill (size D) (layers "START" "END"))]
  [(front_post_machining KIND [(size S)] [(depth D)] [(angle A)])]
  [(back_post_machining KIND [(size S)] [(depth D)] [(angle A)])]
  [(property PAD_PROPERTY)]
  (layers "…" …)
  [(remove_unused_layers yes|no) [(keep_end_layers yes|no)]
   [(zone_layer_connections "…" …)]]
  [(roundrect_rratio R)] [(chamfer_ratio R) (chamfer CORNER …)]
  [(net "NAME")] [(pinfunction "…")] [(pintype "…")]
  [(die_length L)] [(die_delay T)]
  [(solder_mask_margin M)] [(solder_paste_margin M)]
  [(solder_paste_margin_ratio R)] [(clearance C)] [(zone_connect N)]
  [(thermal_bridge_width W)] [(thermal_bridge_angle A)] [(thermal_gap G)]
  [(options …) (primitives …)]
  [(teardrops …)]
  [(tenting (front yes|no|none) (back yes|no|none))]
  (uuid "…")
  [(padstack …)])

This is the order the 10.0 program writes. The reader accepts the items after the shape in any order.

Number, type and shape

The number is the pad's name, which may be text such as A1 or empty. The reader removes the number from kinds of pad that cannot carry one.

TypeMeaning
thru_holeplated through-hole pad
smdsurface-mount pad; any hole size is set to zero
connectedge connector contact; any hole size is set to zero
np_thru_holenon-plated hole
ShapeMeaning
circleround pad
rectrectangle
ovalrectangle with fully rounded ends
trapezoidrectangle skewed by rect_delta
roundrectrectangle with rounded corners; a chamfer_ratio above zero makes it a chamfered rectangle, which is also written as roundrect
customan anchor shape plus drawn primitives

A size of zero or less is replaced by 0.001 mm with a warning.

Holes

  • (drill D) is a round hole. (drill oval W H) is a slot. One number gives both dimensions; the writer leaves out the second when it equals the first.
  • offset moves the copper shape relative to the pad position. It is stored in drill even on pads without a hole, as (drill (offset X Y)).
  • A thru_hole pad with no drill is given a hole of 1 nm, the smallest length the program stores.
  • backdrill is a second drilling of diameter size between two copper layers, and tertiary_drill a third. Both were added with KiCad 10.0 (version 20251101).
  • front_post_machining and back_post_machining take counterbore or countersink, followed by the optional size (diameter), depth and angle. The angle is kept in tenths of a degree.

Layers

layers lists layer names. Besides single names it may use these wildcards.

WildcardLayers
*.Cuall copper layers
*In.Cuall inner copper layers
F&B.Cufront and back copper
*.Adhes, *.Paste, *.SilkS, *.Mask, *.Fab, *.CrtYdthe front and back layer of that kind

A name the reader does not know is mapped to a layer called Rescue.

  • remove_unused_layers is written on every thru_hole pad. With yes, copper is removed from layers where nothing connects, and keep_end_layers says whether the outer layers keep it anyway.
  • zone_layer_connections, written on boards only, lists the copper layers where the pad must keep its copper for a zone connection; the pad's other copper layers are then treated as unconnected. A non-copper layer here is an error.
  • The bare forms remove_unused_layers and keep_end_layers count as yes.

Corners and trapezoids

  • rect_delta DX DY gives the skew of a trapezoid.
  • roundrect_rratio is the corner radius as a ratio of the pad size.
  • chamfer_ratio is the chamfer size as a ratio. chamfer lists the cut corners: any of top_left, top_right, bottom_left and bottom_right. A list that names at least one corner also makes the pad a chamfered rectangle.

Net and electrical data

  • (net "NAME") is the net of a pad on a board. Library footprints carry no net, pin function or pin type. Files from before version 20251028 (KiCad 9.0 and earlier) write (net CODE "NAME"); the code number is then what identifies the net, and a name that disagrees with the code leaves the pad without that net.
  • Net names in files older than version 20210606 use ~…~ for overbars, which the reader converts to ~{…}.
  • pinfunction and pintype copy the name and electrical type of the schematic pin.
  • die_length is the connection length inside the component package. die_delay is a delay in picoseconds; in files of version 20250926 or earlier the value was stored on the length scale and is converted on reading.

Pad properties

property valueMeaning
pad_prop_bgaBGA ball pad
pad_prop_fiducial_globfiducial for the whole board
pad_prop_fiducial_locfiducial local to a footprint
pad_prop_testpointtest point
pad_prop_heatsinkheat sink pad
pad_prop_castellatedcastellated (half-hole edge) pad
pad_prop_mechanicalmechanical pad
pad_prop_pressfitpress-fit pad (version 20250811)
noneno property; accepted but not written

The reader skips other words in property.

Margins and zone connection

These values override the footprint and board settings. When absent they are inherited. In files of version 20240201 or earlier, a value of zero in the first four also meant inherited.

  • solder_mask_margin, solder_paste_margin (lengths) and solder_paste_margin_ratio (a ratio of the pad size).
  • clearance, the copper clearance.
  • zone_connect: 0 no connection, 1 thermal reliefs, 2 solid, 3 thermal reliefs for through-hole pads only.
  • thermal_bridge_width (older name thermal_width) and thermal_gap size the thermal relief.
  • thermal_bridge_angle turns the spokes. The default is 45 for a round pad and for a custom pad with a round anchor (90 for the latter in files of version 20211014 or earlier), and 90 for other pads. The writer leaves out a default value.

Custom pads

(options (clearance outline|convexhull) (anchor circle|rect))
(primitives
  (gr_line (start X Y) (end X Y) (width W))
  (gr_arc (start X Y) (mid X Y) (end X Y) (width W))
  (gr_circle (center X Y) (end X Y) (width W) (fill yes|no))
  (gr_rect (start X Y) (end X Y) [(radius R)] (width W) (fill yes|no))
  (gr_poly (pts …) (width W) (fill yes|no))
  (gr_curve (pts (xy X Y) (xy X Y) (xy X Y) (xy X Y)) (width W))
  (gr_bbox (start X Y) (end X Y) (fill yes|no))
  (gr_vector (start X Y) (end X Y)))
  • anchor is the basic shape at the pad position, sized by size.
  • The clearance option says whether zones keep their distance from the real outline or from its convex hull.
  • Primitive coordinates are relative to the pad. A curve's four points are start, first control point, second control point and end.
  • gr_bbox marks the box where the pad number is drawn. gr_vector is a template for a thermal spoke. Neither is copper.
  • A pts list holds (xy X Y) points and (arc (start X Y) (mid X Y) (end X Y)) segments; an arc needs all three points.
  • The primitives are read like board graphic lines, so older forms of those (such as width with a number, and the angle form of an arc in files of version 20210925 or earlier) are accepted.

Padstacks

Since version 20240929 a pad may differ from copper layer to copper layer. The items in the pad itself describe the front layer, and padstack the others.

(padstack
  (mode front_inner_back|custom)
  (layer "Inner"|"LAYER"
    (shape SHAPE)
    (size W H)
    [(rect_delta DX DY)] [(offset X Y)]
    [(roundrect_rratio R)] [(chamfer_ratio R) (chamfer CORNER …)]
    [(options (anchor circle|rect)) (primitives …)]
    [(thermal_bridge_angle A)] [(thermal_gap G)] [(thermal_bridge_width W)]
    [(clearance C)] [(zone_connect N)]
    [(tenting …)])
  …)
  • In mode front_inner_back there are entries for Inner (all inner layers) and B.Cu.
  • In mode custom there is one entry for each copper layer after F.Cu, named by layer. A footprint file, which has no board, lists every possible copper layer.
  • Inner is accepted only in front_inner_back; any other name must be a copper layer.
  • Inside an entry, options carries the anchor only. The reader reads and ignores a clearance option there and skips other lists.
  • The 10.0 writer puts no tenting in an entry. The reader accepts it there, but applies it to the pad's front and back sides, not to that layer. A thermal_bridge_angle in an entry likewise applies to the whole pad.

Teardrops

The settings for the copper fillet where a track meets a pad (or a via, in board files). The 10.0 program writes the list on a pad only when it differs from the defaults.

(teardrops
  (best_length_ratio R) (max_length L)
  (best_width_ratio R) (max_width W)
  (curved_edges yes|no)
  (filter_ratio R)
  (enabled yes|no)
  (allow_two_segments yes|no)
  (prefer_zone_connections yes|no))
  • The best ratios set the preferred length and width of the teardrop relative to the pad; the maximums cap them.
  • filter_ratio limits teardrops by the ratio of track width to pad size.
  • allow_two_segments lets a teardrop run on into the next track segment.
  • prefer_zone_connections yes means no teardrop where the pad already connects to a zone.
  • Before reading the list, the reader sets teardrops off, two segments off and teardrops on pads in zones on.
  • Older files use (curve_points N), where a number above zero means curved edges.

Tenting

(tenting (front yes|no|none) (back yes|no|none)) says whether solder mask covers the pad's hole on each side; none inherits the board setting. The list is written only when a side is set. KiCad 9.0 writes an older form, a list of bare words such as (tenting front back), (tenting front) or (tenting none): front and back turn a side on, and none clears both.

Older forms

  • A bare locked word after the shape, and a (locked …) list, come from development versions of KiCad 6; both are ignored.
  • tstamp is read as uuid. Identifiers in older files are not quoted.
  • solder_paste_margin_ratio, thermal_width and the numbered net form are described above.
  • Old files may leave net names unquoted, including names that look like numbers.

Divergence from spec

The KiCad developer documentation describes pads as KiCad 6.0 wrote them. It does not cover padstacks, backdrills, post-machining, die delay, teardrops, tenting, zone layer connections or the press-fit property, and it shows nets with a code number, which version 10.0 no longer writes.

Links

Developers

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

Reference