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
atis relative to the footprint. On a placed footprint the angle is the pad's total angle, including the footprint's rotation. yes/nois a boolean.yes/no/noneis a three-state value wherenonemeans 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.
| Type | Meaning |
|---|---|
thru_hole | plated through-hole pad |
smd | surface-mount pad; any hole size is set to zero |
connect | edge connector contact; any hole size is set to zero |
np_thru_hole | non-plated hole |
| Shape | Meaning |
|---|---|
circle | round pad |
rect | rectangle |
oval | rectangle with fully rounded ends |
trapezoid | rectangle skewed by rect_delta |
roundrect | rectangle with rounded corners; a chamfer_ratio above zero makes it a chamfered rectangle, which is also written as roundrect |
custom | an 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.offsetmoves the copper shape relative to the pad position. It is stored indrilleven on pads without a hole, as(drill (offset X Y)).- A
thru_holepad with nodrillis given a hole of 1 nm, the smallest length the program stores. backdrillis a second drilling of diametersizebetween two copper layers, andtertiary_drilla third. Both were added with KiCad 10.0 (version 20251101).front_post_machiningandback_post_machiningtakecounterboreorcountersink, followed by the optionalsize(diameter),depthandangle. The angle is kept in tenths of a degree.
Layers
layers lists layer names. Besides single names it may use these wildcards.
| Wildcard | Layers |
|---|---|
*.Cu | all copper layers |
*In.Cu | all inner copper layers |
F&B.Cu | front and back copper |
*.Adhes, *.Paste, *.SilkS, *.Mask, *.Fab, *.CrtYd | the front and back layer of that kind |
A name the reader does not know is mapped to a layer called Rescue.
remove_unused_layersis written on everythru_holepad. Withyes, copper is removed from layers where nothing connects, andkeep_end_layerssays 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_layersandkeep_end_layerscount asyes.
Corners and trapezoids
rect_delta DX DYgives the skew of a trapezoid.roundrect_rratiois the corner radius as a ratio of the pad size.chamfer_ratiois the chamfer size as a ratio.chamferlists the cut corners: any oftop_left,top_right,bottom_leftandbottom_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~{…}. pinfunctionandpintypecopy the name and electrical type of the schematic pin.die_lengthis the connection length inside the component package.die_delayis 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 value | Meaning |
|---|---|
pad_prop_bga | BGA ball pad |
pad_prop_fiducial_glob | fiducial for the whole board |
pad_prop_fiducial_loc | fiducial local to a footprint |
pad_prop_testpoint | test point |
pad_prop_heatsink | heat sink pad |
pad_prop_castellated | castellated (half-hole edge) pad |
pad_prop_mechanical | mechanical pad |
pad_prop_pressfit | press-fit pad (version 20250811) |
none | no 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) andsolder_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 namethermal_width) andthermal_gapsize the thermal relief.thermal_bridge_angleturns 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)))anchoris the basic shape at the pad position, sized bysize.- The
clearanceoption 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_bboxmarks the box where the pad number is drawn.gr_vectoris a template for a thermal spoke. Neither is copper.- A
ptslist 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
widthwith 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_backthere are entries forInner(all inner layers) andB.Cu. - In mode
customthere is one entry for each copper layer afterF.Cu, named by layer. A footprint file, which has no board, lists every possible copper layer. Inneris accepted only infront_inner_back; any other name must be a copper layer.- Inside an entry,
optionscarries the anchor only. The reader reads and ignores aclearanceoption there and skips other lists. - The 10.0 writer puts no
tentingin an entry. The reader accepts it there, but applies it to the pad's front and back sides, not to that layer. Athermal_bridge_anglein 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_ratiolimits teardrops by the ratio of track width to pad size.allow_two_segmentslets a teardrop run on into the next track segment.prefer_zone_connections yesmeans 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
lockedword after the shape, and a(locked …)list, come from development versions of KiCad 6; both are ignored. tstampis read asuuid. Identifiers in older files are not quoted.solder_paste_margin_ratio,thermal_widthand the numberednetform 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
- S-expression format introduction – KiCad developer documentation, pad section