Introduction
A .kicad_pcb file holds one printed circuit board of
KiCad, the free electronics design suite. It is
UTF-8 text made of nested S-expressions. The form arrived with KiCad 4.0; the KiCad
developer documentation describes it for version 6 and later.
Syntax
- Every item is a list in parentheses:
(token attributes…). Tokens are lower case and hold only letters, digits and underscores. The style is based on the Specctra DSN format. - Strings are in double quotes. Files written before version 6 quote them only where needed.
- All lengths and coordinates are in millimetres, without exponents. The internal unit is one nanometre, so there are at most six decimal places.
- Coordinates are relative to the origin of the containing item: pads and graphics of a footprint are relative to the footprint.
(at X Y [ANGLE])places an item; the angle is in degrees.- Point lists are
(pts (xy X Y) …). - The header must come first. The order of the other sections is not critical.
- In files before format 20240706 the character
|may be part of an unquoted string.
(kicad_pcb
(version 20211014)
(generator example)
(general (thickness 1.6))
(paper "A4")
(layers
(0 "F.Cu" signal)
(31 "B.Cu" signal)
(44 "Edge.Cuts" user)
)
(net 0 "")
(net 1 "GND")
(segment (start 100 50) (end 110 50) (width 0.25)
(layer "F.Cu") (net 1)
(tstamp 3f0c1b2a-8d4e-4a51-9c1e-2b7a6d5e4f30))
(gr_line (start 95 45) (end 115 45) (layer "Edge.Cuts") (width 0.1)
(tstamp 7a9d2c41-0b6f-4e83-a5d2-91c4f8e3b607))
)
Header and versions
(version N) is the format version, a date written as YYYYMMDD, and
(generator NAME) names the writing program. KiCad 9.0 and 10.0 write
(generator "pcbnew") and add generator_version; other
programs are asked not to call themselves pcbnew. The version history in
the KiCad source groups the numbers as follows.
| Format version | KiCad | Some changes |
|---|---|---|
| 3, 4 | 4.0 | First S-expression files; version 4 reversed the copper stack and allowed 32 copper layers. Version 2 was the last of the older, non S-expression format |
| 20160815 – 20171130 | 5.0 | Differential pair settings, custom pad shapes, 3D model offset in millimetres instead of inches |
| 20190331 – 20211014 | 6.0 | module renamed footprint (20201115), page became paper, track arcs, groups, rectangles, new dimensions |
| 20211226 – 20221018 | 7.0 | Radial dimensions, stroke line styles, fonts, text boxes, images, net ties |
| 20230410 – 20240108 | 8.0 | Footprint fields, uuid, generated objects, yes/no booleans in footprints |
| 20240201 – 20241229 | 9.0 | Tables, tenting, embedded files, component classes, padstacks and via stacks, any number of user layers |
| 20250210 – 20260206 | 10.0 | Via protection, rounded rectangles, points, barcodes, blind and buried vias split, nets no longer numbered (20251028), variants |
| 20260410 and later | 11.0 development | Extruded 3D bodies, ellipses, net chains, footprint transforms, constraints, grids and more |
Sections
KiCad 10.0 writes the header, then general, paper,
title_block, layers, setup, the properties and
the variants. The items follow in this order: footprints, drawings, points, tracks and
vias, zones, groups, generated objects, embedded_fonts and the embedded
files. The 10.0 reader accepts these tokens at the top level of a board.
| Token | Contents |
|---|---|
version, generator, generator_version | The header. host is the older form of generator; in files before format 20200825 a build string follows the name |
general | (thickness T) and (legacy_teardrops yes|no). The counts and area of old files are skipped |
paper | A size name, or User with width and height in millimetres, then optionally portrait. An unknown name is an error. page is accepted up to format 20200119 |
title_block | title, date, rev, company and (comment N "text") with N from 1 to 9 |
layers | The enabled layers, see layers |
setup | See setup, stack-up and plot settings |
property | (property "KEY" "VALUE") |
variants | (variants (variant (name "N") [(description "D")]) …), written by 10.0 only when the board has variants |
net, net_class | The numbered net list and the net classes of older boards, see nets. KiCad 10.0 writes no net list |
footprint, module | The placed components; module is the older name |
gr_line, gr_rect, gr_arc, gr_circle, gr_curve, gr_poly, gr_text, gr_text_box, table, image, barcode, dimension, target, point | Board graphics |
segment, arc, via | Tracks |
zone | Copper fills and rule areas |
group, generated | Named sets of items, and generated objects |
embedded_fonts, embedded_files | (embedded_fonts yes|no) and the files stored in the board. 10.0 merges the files of all footprints into this one list; a fault in it only gives a warning |
Design rule markers are not saved in the board file.
Items carry a random (version 4) UUID, written tstamp on tracks in
version 6 boards and (uuid …) in later files. Timestamps of boards older
than version 6 are converted into UUID form.
Layers
(layers (N "NAME" TYPE [hide | "USER NAME"]) …) lists the enabled layers,
the copper layers first from front to back. Files use fixed canonical names; the user
name is written only when it differs. A * wildcard covers several layers where
an item names them, as in *.Cu.
| Names | Numbers in 9.0 and 10.0 | Layers |
|---|---|---|
F.Cu, In1.Cu – In30.Cu, B.Cu | 0, 4 – 62 (even), 2 | Copper |
F.Adhes, B.Adhes | 9, 11 | Adhesive |
F.Paste, B.Paste | 13, 15 | Solder paste |
F.SilkS, B.SilkS | 5, 7 | Silk screen |
F.Mask, B.Mask | 1, 3 | Solder mask |
Dwgs.User, Cmts.User, Eco1.User, Eco2.User | 17, 19, 21, 23 | Drawings, comments, engineering changes |
Edge.Cuts, Margin | 25, 27 | Board outline and margin |
F.CrtYd, B.CrtYd | 31, 29 | Courtyard |
F.Fab, B.Fab | 35, 33 | Fabrication |
User.1 – User.45 | 39 – 127 (odd) | User layers |
- The type is
signal,power,mixedorjumperfor copper. Other layers are writtenuser, except that a user layer fromUser.1up may be writtenfrontorback. The reader also acceptsauxiliary, which 10.0 writes back asuser. - The 10.0 reader ignores the numbers. Copper entries must come first: it takes the entries as copper up to the first one whose type is not
signal,power,mixed,jumper,front,backorauxiliary, normallyuser. The first copper entry becomesF.Cu, the lastB.Cu, and those between are matched by name, or by position if the name is not known. There must be at least two copper layers and an even number of them. - Other layers are matched by name. Old Italian, Polish and French layer names are translated; any other unknown name is an error.
hidestands in place of the user name and marks the layer as not visible. A user name must be a quoted string. Before format 20200922 the name given is also the user name.- If an item lies on a layer missing from the list, the program offers to move it to
Cmts.User; otherwise loading fails.
Numbers before 9.0
KiCad 9.0 introduced the numbers above. KiCad 6.0 and 8.0 define the following,
with each pair of technical layers listed back first. These are also the bit
positions behind layer masks such as layerselection in their
plot settings.
| Layers | Numbers |
|---|---|
F.Cu, In1.Cu – In30.Cu, B.Cu | 0, 1 – 30, 31 |
B.Adhes, F.Adhes, B.Paste, F.Paste | 32 – 35 |
B.SilkS, F.SilkS, B.Mask, F.Mask | 36 – 39 |
Dwgs.User, Cmts.User, Eco1.User, Eco2.User | 40 – 43 |
Edge.Cuts, Margin | 44, 45 |
B.CrtYd, F.CrtYd, B.Fab, F.Fab | 46 – 49 |
User.1 – User.9 | 50 – 58 |
Setup
(setup
[(stackup …)]
(pad_to_mask_clearance X)
[(solder_mask_min_width X)]
[(pad_to_paste_clearance X)]
[(pad_to_paste_clearance_ratio R)]
(allow_soldermask_bridges_in_footprints yes|no)
(tenting (front yes|no) (back yes|no))
(covering (front yes|no) (back yes|no))
(plugging (front yes|no) (back yes|no))
(capping yes|no)
(filling yes|no)
[(zone_defaults (property (layer "NAME") (hatch_position (xy X Y))) …)]
[(aux_axis_origin X Y)]
[(grid_origin X Y)]
(pcbplotparams …))
setup as KiCad 10.0 writes it. The bracketed items are left out when zero or empty, and the stack-up when the board has none.- The reader takes the items in any order. An unknown one is an error. An absent
solder_mask_min_widthmeans 0. A file without a stack-up gets a default one built from its copper layer count. pad_to_mask_clearance,solder_mask_min_widthandpad_to_paste_clearanceare lengths; the ratio is a plain number.aux_axis_originandgrid_originare an X and a Y.allow_soldermask_bridges_in_footprints,cappingandfillingtakeyesorno.tenting,coveringandplugginghold(front V)and(back V)with V one ofyes,noornone; a side that is missing ornoneis off. Older files write tenting as bare words,(tenting front back)or(tenting none): the sides named are on.zone_defaultsholds onlypropertylists, one per layer, each with(layer "NAME")and(hatch_position (xy X Y)), the hatch offset on that layer.
Older setup items
Boards from before version 6 kept design rules here. KiCad now holds most of them in the project file, but the 10.0 reader still takes these.
| Item | Meaning |
|---|---|
trace_clearance, via_size, via_drill, uvia_size, uvia_drill | Clearance, via diameter and drill, and microvia diameter and drill of the default net class |
user_trace_width W | One entry of the track width list; repeated |
user_via D DRILL | One entry of the via size list; repeated |
user_diff_pair W GAP VIAGAP | One entry of the differential pair list; repeated |
clearance_min, trace_min | Minimum clearance and minimum track width |
via_min_size, via_min_annulus | Minimum via diameter and annular ring |
through_hole_min (older via_min_drill) | Minimum through-hole drill |
hole_to_hole_min | Minimum distance between holes |
uvia_min_size, uvia_min_drill | Minimum microvia diameter and drill |
zone_clearance | Default zone clearance |
segment_width, edge_width, mod_edge_width | Default line widths on copper, board outline and silk screen (before version 6) |
pcb_text_width, mod_text_width | Default text thickness on copper and silk screen (before version 6) |
pcb_text_size W H, mod_text_size W H | Default text size on copper and silk screen (before version 6) |
pad_size W H, pad_drill D | Size and drill of a new pad |
max_error | Largest allowed deviation when curves are approximated |
visible_elements | A hexadecimal bit set of what the editor shows (before version 6) |
last_trace_width, zone_45_only, uvias_allowed, blind_buried_vias_allowed, filled_areas_thickness | Read and dropped. All but the first take yes or no |
defaults | A list of drawing defaults, below |
- Inside
defaults:edge_clearance(copper to board edge); the line widthscopper_line_width,silk_line_width,edge_cuts_line_width,courtyard_line_width,fab_layers_line_widthandother_layers_line_width;dimension_units(0 inches, 1 mils, 2 millimetres, 3 automatic); anddimension_precision, where 0 to 5 give that many decimal places and higher values select a precision that depends on the units. - Also inside
defaults:copper_text_dims,silk_text_dims,fab_layers_text_dimsandother_layers_text_dims, each holding(size X Y),(thickness T)and the bare wordsitalicandkeep_upright.
Nets and net classes
(net N "NAME")
(net_class NAME "DESCRIPTION"
(clearance X) (trace_width X)
(via_dia X) (via_drill X)
(uvia_dia X) (uvia_drill X)
(diff_pair_width X) (diff_pair_gap X)
(add_net "NAME") …)
- Up to version 9 each net is listed once with a number, and net 0 with an empty name stands for no net. Items on the board refer to the number with
(net N). - Files with format 20251028 or later have no list and write
(net "NAME")on the items. The 10.0 reader tells the two forms apart by whether a number or a name follows; a new name creates the net. - In files before format 20210606 an overbar written
~NAME~in a net name is converted to~{NAME}. - A
net_classnamed like the default class replaces it. Two classes with the same name are an error. Eachadd_netassigns one net to the class.
Stack-up
stackup lists the physical layers from front to back. KiCad 10.0 writes
it as follows.
(stackup
(layer "NAME" (type "TYPE")
[(color "C")] [(thickness T [locked])] [(material "M")]
[(epsilon_r E)] [(loss_tangent D)]
[addsublayer …the same five items…])
…
[(copper_finish "F")]
(dielectric_constraints yes|no)
[(edge_connector yes|bevelled)]
[(edge_plating yes)])
| Layer | Name and usual type | Items it can hold |
|---|---|---|
| Silk screen | F.SilkS, B.SilkS; "Top Silk Screen", "Bottom Silk Screen" | color, material |
| Solder paste | F.Paste, B.Paste; "Top Solder Paste", "Bottom Solder Paste" | None |
| Solder mask | F.Mask, B.Mask; "Top Solder Mask", "Bottom Solder Mask" | color, thickness, material, epsilon_r, loss_tangent |
| Copper | The layer name; "copper" | thickness |
| Dielectric | "dielectric N", N from 1; "core" or "prepreg" | All five, and locked on the thickness. epsilon_r and loss_tangent are written only with a material, as on the mask |
When the reader builds a default stack-up, copper is 0.035 mm and each solder mask 0.01 mm thick. The rest of the board thickness is divided equally among the dielectrics, which are FR4 and alternate between core and prepreg, starting with core.
The 10.0 reader takes the following inside stackup.
(layer "NAME" …)describes one layer, with the name matched against the canonical names of the enabled board layers. A name that matches none stands for a dielectric; dielectrics are numbered in the order read. An enabled layer of any other kind, such as the board outline, is an error.- A layer may give
type,thickness,material,epsilon_r,loss_tangentandcolor. On a dielectric,lockedmay follow the thickness value. - The word
addsublayerstarts a further sheet of the same dielectric. - A custom colour written as
#digits without an opacity, in files before format 20210824, is given the default opacity. - The stack-up as a whole may give
copper_finish,edge_plating yes,dielectric_constraints yesandedge_connector(yesorbevelled). The oldercastellated_pads, and unknown items, are skipped. - Once a board layer appears a second time, as in a stack-up saved twice, the reader ignores that entry and every layer entry after it. Entries beyond 128 are dropped.
Plot settings
pcbplotparams keeps the last plot dialogue settings. Booleans are read as
yes, no, true or false. Numbers
outside their range are moved to the nearest limit, and an unknown item is skipped.
The table lists what KiCad 10.0 writes, in order, with the value of a new board in
parentheses.
| Token | Meaning |
|---|---|
layerselection | 0x followed by a hexadecimal bit set of the layers to plot. In files before format 20240819 the bits follow the old layer numbering. A plain number, from the first S-expression files, selects both silk screens and all copper |
plot_on_all_layers_selection | The same kind of bit set: layers added to every plotted layer |
disableapertmacros (no) | Gerber: do not use aperture macros |
usegerberextensions (no) | Gerber: Protel file name extensions |
usegerberattributes (yes) | Gerber: X2 attributes |
usegerberadvancedattributes (yes) | Gerber: netlist information |
creategerberjobfile (yes) | Gerber: write a job file |
gerberprecision (6) | Gerber: digits after the decimal point, 5 or 6. Written only when 5 |
dashed_line_dash_ratio (12), dashed_line_gap_ratio (3) | Dash and gap lengths of dashed lines |
svgprecision (4) | SVG number precision, 3 to 6 |
plotframeref (no) | Plot the drawing sheet |
mode | DXF outline mode, 1 filled or 2 sketch. Still written, but the 10.0 reader discards it |
useauxorigin (no) | Use the auxiliary origin |
pdf_front_fp_property_popups, pdf_back_fp_property_popups, pdf_metadata (all yes), pdf_single_document (no) | PDF: footprint property pop-ups, document metadata, one document for all layers |
dxfpolygonmode (yes), dxfimperialunits (yes), dxfusepcbnewfont (yes) | DXF: polygon mode, inch units, KiCad's own text strokes instead of native text |
psnegative (no), psa4output (no) | Negative plot, A4 output |
plot_black_and_white (yes) | Plot without colour |
sketchpadsonfab (no), plotpadnumbers (no) | Pad outlines and pad numbers on the fabrication layers |
hidednponfab (no), sketchdnponfab (yes), crossoutdnponfab (yes) | How parts marked do-not-populate appear on the fabrication layers |
subtractmaskfromsilk (no) | Remove mask openings from the silk screen |
outputformat (1) | 0 HPGL, 1 Gerber, 2 PostScript, 3 DXF, 4 PDF, 5 SVG |
mirror (no) | Mirrored plot |
drillshape (1) | Drill marks: 0 none, 1 a small mark, 2 the actual hole size |
scaleselection (1) | Index of the scale chosen in the dialogue, 0 to 4 |
outputdirectory | Output folder |
The reader also meets older items. excludeedgelayer no adds
Edge.Cuts to the layers plotted on all layers, and viasonmask
sets the via tenting of the setup for both sides: yes (vias plotted on
the mask layers) leaves vias untented, no tents them.
svguseinch,
pscolor, plotinvisibletext, hpglpennumber,
hpglpenspeed and hpglpenoverlay are read and dropped. The
keyword list also has linewidth, plotreference,
plotvalue, plotfptext and hpglpendiameter,
which the 10.0 reader skips as it does unknown items.
Footprints, pads and graphics
Boards share the syntax of these items with footprint files, where it is described.
- Footprints – structure, fields, local settings, attributes, variants, 3D models and embedded files
- Pads – holes, layers, nets, custom shapes, padstacks, teardrops and tenting
- Graphics – lines and shapes, text, text boxes, tables, images, barcodes, dimensions and points; on a board the shapes are named
gr_line,gr_arcand so on
What differs on the board
- Shapes, text and text boxes directly on the board are in board coordinates. For those inside a footprint, the 10.0 reader turns the position by the footprint's orientation and adds the footprint's position. The angle of footprint text is absolute in the file, and dimensions inside a footprint use board coordinates.
hide,unlocked(keep upright) and the old bareunlockedafter an angle belong to footprint text only. Ongr_textthey are errors.- Copper shapes on a board can carry a net, as can pads, which also record
pinfunctionandpintype.
Targets
A target is an alignment mark that exists only on boards.
(target plus|x (at X Y) (size S) [(width W)] (layer "NAME") (uuid "…"))
plus or x. size is a single length; width, the line thickness, is left out when zero. The reader takes the items in any order and also accepts tstamp for uuid.Generated objects
A generated list, such as a length tuning pattern, records the settings
of an object KiCad builds and the items that belong to it. KiCad 10.0 writes
(generated (uuid "…") (type NAME) (name "…") (layer "NAME") [(locked yes)]
(KEY VALUE) …
(members "UUID" …))
yes or no, (xy X Y) points, (pts …) chains or quoted strings. An empty tuning pattern is not written.- The reader wants
uuidfirst. Files with formats from 20231007 up to, not including, 20231215 wroteidthere. - Then come
type,name,layer(front copper if absent),locked yesandmembers, as in a group. Every other key is stored as a property. - A type KiCad cannot create is an error. A tuning pattern without members is ignored.
Length tuning patterns
The type is tuning_pattern; meanders is the name used by
the 7.99 development versions. KiCad 10.0 keeps these properties. Lengths are in
millimetres.
| Key | Value |
|---|---|
origin, end | Points where the pattern starts and ends |
tuning_mode | "single" track, "diff_pair" or "diff_pair_skew"; anything else counts as single |
initial_side | "default", "left" or "right". The reader also asks for a key side, which 10.0 does not write |
last_status | "too_long", "too_short" or "tuned"; anything else counts as tuned |
target_length, target_length_min, target_length_max | Wanted length and its limits |
target_delay, target_delay_min, target_delay_max | The same as a signal delay, stored divided by one million like a length |
target_skew, target_skew_min, target_skew_max | Wanted skew of a pair and its limits |
is_time_domain | yes when the target is a delay |
min_amplitude, max_amplitude, min_spacing | Size and spacing of the meanders |
corner_radius_percent | Corner radius as a percentage |
rounded | yes for round corners, no for chamfers |
single_sided | Meanders on one side only |
override_custom_rules | Use these settings instead of the custom design rules |
last_track_width, last_diff_pair_gap, last_tuning_length, last_netname | Values remembered from the last tuning run |
base_line, base_line_coupled | The untuned path, and that of the other track of a pair, as pts |
Tracks and vias
Segments and arcs
(segment (start X Y) (end X Y) (width W) [(locked yes)]
(layer "F.Cu") | (layers "F.Cu" "F.Mask") [(solder_mask_margin M)]
(net "NAME") (uuid "…"))
(arc (start X Y) (mid X Y) (end X Y) (width W) …the same…)
- A track with a solder mask opening names two layers with
layers: one outer copper layer and the mask layer of the same side. The reader wants exactly one copper layer and at most one mask layer, and no mask with an inner layer. The margin is written only for an opening on an outer layer. - An item whose layer is not copper is discarded. An arc whose three points are in a straight line is loaded as a segment.
- The identifier is
uuid, ortstampin older files.statuswith a hexadecimal number is read and dropped. lockedmay be(locked yes),(locked)or, in old files, a bare word before the first list.
Vias
(via [blind|buried|micro] (at X Y) (size D) (drill D)
[(backdrill (size D) (layers "A" "B"))]
[(tertiary_drill (size D) (layers "A" "B"))]
[(front_post_machining counterbore|countersink [(size D)] [(depth D)] [(angle DEG)])]
[(back_post_machining …)]
(layers "F.Cu" "B.Cu")
[(remove_unused_layers yes) (keep_end_layers yes|no) | (start_end_only yes)]
[(locked yes)] [(free yes)]
[(zone_layer_connections "NAME" …)]
[(tenting (front V) (back V))] [(capping V)]
[(covering (front V) (back V))] [(plugging (front V) (back V))] [(filling V)]
[(padstack …)] [(teardrops …)]
(net "NAME") (uuid "…"))
yes, no or none.| Token | Meaning |
|---|---|
| type word | None for a through via; otherwise blind, buried or micro |
size, drill | Pad diameter (on the front layer, if the diameters differ) and drill diameter |
layers | The two copper layers where the via starts and ends |
backdrill, tertiary_drill | Further drilling: its diameter and the two layers it runs between |
front_post_machining, back_post_machining | A counterbore or countersink on that side, with diameter, depth and angle in degrees; zero values are not written |
remove_unused_layers, keep_end_layers | Remove the copper rings on unconnected layers; with keep_end_layers yes the two end layers keep theirs. With neither token all rings stay |
start_end_only | Rings on the start and end layers only |
free | A free via, which keeps the net it was given |
zone_layer_connections | Written with removed rings: the copper layers where a zone connection keeps the ring; the via's other copper layers are marked as having none. The list may be empty. It has to follow layers |
tenting, covering, plugging, capping, filling | Via protection. none, or an absent token, follows the board setup. Tenting is also accepted in the bare-word form, (tenting front back) or (tenting none) |
teardrops | Teardrop settings, as on pads; written when not the default |
Via stacks
(padstack (mode front_inner_back)
(layer "Inner" (size D))
(layer "B.Cu" (size D)))
(padstack (mode custom)
(layer "In1.Cu" (size D)) … (layer "B.Cu" (size D)))
size.mode is front_inner_back or custom and comes
before the layers. The layer name Inner is allowed only in the first
mode. Every layer must be copper, and size, one diameter, is the only
item a layer takes.
Older forms
- Up to version 9,
netholds the number from the net list instead of a name. - In files before format 20250228 a via has covering, plugging, filling and capping off, not taken from the setup.
- Flags may be bare words, as in
(via blind locked (at …; the 10.0 reader takesblind,buriedandmicroas bare words.
Zones and groups
Copper zones, rule areas and groups have the same syntax in boards and footprints: see zone syntax, rule areas, older zone forms and groups. The 10.0 reader drops a board zone that has no outline points, and limits the layers of a zone to the layers the board has enabled.
Boards written by KiCad 9.0
Comparing the 9.0 and 10.0 writers, a board from KiCad 9.0 differs as follows. The
header, general, layers and generated are
written alike, and the list of plot keywords is the same.
- The nets are numbered, with the list
(net N "NAME")after the properties. Tracks and vias end with(net N)before theuuid, graphic shapes that belong to a net carry(net N), pads carry(net N "NAME")and zones(net N) (net_name "NAME"); rule areas and zones off copper get net 0 and an empty name. - There are no variants and no points.
- In
setup,tentingtakes bare words,(tenting front back)or(tenting none), and there is nocovering,plugging,capping,fillingorzone_defaults. - The stack-up may include
(castellated_pads yes), beforeedge_plating. KiCad 10.0 skips it. - The plot settings include
hpglpennumber,hpglpenspeedandhpglpendiameter, and 9.0 usesmodeto choose filled or sketch plotting. - A via is marked only
blind(which covers buried vias) ormicro; there is noburied, backdrill or post machining. Its tenting is written with bare words as above, only when set, and there is no covering, plugging, capping or filling.
Divergence from spec
- The documentation numbers
outputformatas 0 Gerber, 1 PostScript, 2 SVG, 3 DXF, 4 HPGL, 5 PDF. In the 10.0 source 0 is HPGL, 1 Gerber, 2 PostScript, 3 DXF, 4 PDF and 5 SVG. - It lists
hpglpendiameterandplotreferenceamong the plot settings; KiCad 10.0 does not read them. - The documentation writes the track arc width as
(width X Y); KiCad writes one value. - Its example board is a version 3 file with
module,pageandnet_class, older than the syntax the same page describes. - It documents
tstamp, net ordinals and bare flags, which later versions replaced as noted above.
Recognising and reading a file
The text starts with (kicad_pcb, followed soon by
(version. A reader parses the whole file into a tree of lists and checks
the version. KiCad 10.0 stops with a parse error at an unknown token at the top level
of a board. Older boards use module where newer ones use
footprint. KiCad 10.0 refuses a board whose version is higher than
20260206 with an error saying that the format is newer.
Old KiCad boards with the extension .brd, up to format version 2, are
not S-expressions. They are a different format, the
KiCad legacy board file.
In the explorer
A dropped .kicad_pcb file shows its lists as a byte tree and a drawing
of the board: footprints with their pads, graphics and texts, tracks, arcs, vias,
zones with their filled areas, dimensions, barcodes, text boxes and tables. Options choose the
layers and the size of the picture. A click in the picture selects the bytes of the
item. Tables list every footprint, pad, track, via, zone, graphic item, field, net,
group, layer and 3D model location. PNG and JPEG images are painted on the board.
Embedded files and images open as files of their own, and the checksum of each
embedded file is compared with its data. The stack-up is listed layer by layer and
dielectric sheet by sheet, and the other setup values and the plot settings have
tables of their own.
Solder mask and paste layers show pads with their margins, and the mask openings of vias that are not tented. A layer choice picks the matching padstack entry of a pad or via; 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. An option rings the vias that are covered, plugged, filled, capped or tented, and another chooses an assembly variant, whose field values then appear in the texts. Zone outlines carry their edge or full hatching. Tables list the variants and the padstack, drilling and protection settings of pads and vias.
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
Known, not yet covered
- Reference: what development versions after 10.0 add (formats 20260410 and later).
- 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 and vias are drawn on every layer they name, also where the file asks for unused copper to be removed.
Links
Software
- KiCad – free electronics design suite; its PCB editor reads and writes the format (Windows, macOS, Linux)
Developers
- KiCad source – the reference reader and writer, GPL (C++)
Reference
- Board file format – KiCad developer documentation
- S-expression format – shared syntax, footprints, graphics and zones, KiCad developer documentation
- pcb_io_kicad_sexpr.h – the history of format version numbers (C++)
- KiCad 10.0 board writer – what 10.0 files hold (C++)
- KiCad 10.0 board reader – current and older forms (C++)
- pcb_plot_params.cpp – plot settings, writer and reader (C++)
- board_stackup.cpp – stack-up writer and default stack-up (C++)
- pcb_tuning_pattern.cpp – length tuning pattern properties (C++)