Introduction
A .kicad_sch file is one sheet of a circuit diagram made with KiCad. It is plain UTF-8 text in an S-expression syntax: lists in parentheses whose first word names the item. The format arrived with KiCad 6 and replaced the older .sch files. A design with several sheets is a tree of files, joined by sheet items. Each file carries a copy of every library symbol it uses, so it can be drawn without the libraries. This page gives the syntax of KiCad 10.0 (file version 20260306) and KiCad 9.0 (20250114), with the older forms that the 10.0 reader still accepts. Board files use the same syntax.
Syntax
- Text strings are in double quotes with backslash escapes. Keywords are lower case. The text syntax is that of symbol libraries.
- Lengths are in millimetres, written without exponents, to a resolution of 0.0001 mm. The Y axis of sheet items points down.
(at X Y [ANGLE])gives a position and an angle in degrees.(pts (xy X Y) …)is a list of points.- Booleans are written
(key yes)or(key no). A few flags are also accepted as(key), meaning yes:fields_autoplaced, andshow_nameanddo_not_autoplaceon a property. Inside text effects,hide,boldanditalicmay also be bare words. (uuid "…")identifies an item with a version 4 UUID. Files converted from older formats hold UUIDs made from the old time stamps. When two items carry the same UUID, the reader changes one of them for most item types.- A library identifier is
"LIBRARY:SYMBOL". The escape{slash}in an older identifier is read as/. - Square brackets below mark optional parts; they are not in the file.
File structure
KiCad 10.0 writes:
(kicad_sch
(version 20260306)
(generator "eeschema")
(generator_version "10.0")
(uuid "…")
(paper "A4")
[(title_block …)]
(lib_symbols (symbol "Device:R" …) …)
…drawing items…
[(sheet_instances (path "/" (page "1")))]
[(embedded_fonts yes|no)]
[(embedded_files …)])sheet_instances is written in a sheet file that holds a root instance. embedded_fonts and embedded_files are written in the file of the design's first top-level sheet. KiCad writes the drawing items sorted by type and then UUID. Error markers are not saved. KiCad 9.0 also writes bus_alias entries here; 10.0 keeps bus aliases in the project file but still reads them from a schematic.
Top-level items
The reader accepts these lists inside kicad_sch and rejects any other:
| Words | Meaning |
|---|---|
version | First item. Without it the current version is assumed. |
generator, generator_version, host | Writing program. generator has one value, read and ignored. host is the older form, with two values before version 20200827. |
uuid | Identifier of the sheet file. One is made when missing, and always for files before 20210406. |
paper, page | Page size. Up to version 20200506 the word page means paper. In later files a top-level (page A B) is read and ignored. |
title_block, lib_symbols | Title block; cached library symbols |
symbol, sheet | Placed symbol; sub-sheet |
wire, bus, bus_entry, junction, no_connect, bus_alias | Connections |
label, global_label, hierarchical_label, netclass_flag, directive_label | Labels |
polyline, arc, circle, rectangle, bezier, rule_area | Shapes |
text, text_box, table, image | Text, tables and pictures |
group | Groups of items |
sheet_instances, symbol_instances | Instance lists |
embedded_fonts, embedded_files | Embedded data. A fault in embedded_files gives a warning and the rest of the sheet still loads. |
Page and title block
(paper "SIZE" [portrait]) takes A0 to A5, A to E, USLetter, USLegal, USLedger or GERBER, matched without regard to case. A custom size is (paper "User" WIDTH HEIGHT [portrait]) in millimetres; sizes outside the program's limits are clamped. The title block is left out when every entry is empty, and each empty entry is left out:
(title_block (title "…") (date "…") (rev "…") (company "…")
(comment 1 "…") … (comment 9 "…"))Comment numbers run from 1 to 9; another number is an error. Text anywhere in the sheet can refer to these as ${TITLE}, ${ISSUE_DATE}, ${CURRENT_DATE}, ${REVISION}, ${COMPANY} and ${COMMENT1} to ${COMMENT9}.
Library symbols
Each entry in lib_symbols is a full symbol definition named by library identifier, with its properties, units, graphics and pins, in the syntax of a symbol library file. Only symbol lists are allowed. Derived symbols do not occur here: the cached copy is complete. Inside a symbol definition the file's Y axis points up.
Placed symbols
(symbol
[(lib_name "NAME")]
(lib_id "Device:R")
(at X Y 0|90|180|270)
[(mirror x|y)]
(unit 1)
(body_style 1)
(exclude_from_sim no) (in_bom yes) (on_board yes)
(in_pos_files yes) (dnp no)
[(fields_autoplaced yes)]
(uuid "…")
(property "Reference" "R1" …)
(property "Value" "10k" …) …
(pin "1" (uuid "…") [(alternate "NAME")]) …
(instances
(project "NAME"
(path "/ROOT-UUID/SHEET-UUID" (reference "R1") (unit 1)
[(variant …)] …) …) …))lib_namenames the entry inlib_symbolswhen it differs fromlib_id, for example after a local edit.- The angle must be 0, 90, 180 or 270; others are an error.
unitpicks a unit of a multi-unit part.body_stylepicks the drawing: 1 is the normal one, 2 the De Morgan alternative or the second custom style. Older files, including those of KiCad 9.0, writeconvertwith the same meaning.in_pos_files(new after 9.0) includes the part in placement files.dnpmeans do not populate.- A
pinentry gives the pin number, its UUID and the chosen alternate function. In files before version 20210126 the pin UUID is ignored, because the first writer stored the symbol's UUID there.
Instances and variants
instances records the reference designator and unit for every place the sheet is used, grouped by project name. A path is the chain of sheet UUIDs from the root. Inside project only path lists occur. A path holds reference and unit; the reader also takes value and footprint there, written by some older versions, and puts them in the symbol's Value and Footprint fields. The unit and Reference field written on the symbol itself come from one of the instances.
KiCad 10.0 adds variants, which are alternative builds of the same design. A variant lists what differs for one instance:
(variant (name "NAME")
[(dnp yes|no)] [(exclude_from_sim yes|no)] [(in_bom yes|no)]
[(on_board yes|no)] [(in_pos_files yes|no)]
[(field (name "FIELD") (value "TEXT"))] …)Anything left out keeps the item's own setting. in_bom, on_board and in_pos_files say that the item is included. In variant files older than 20260306, in_bom has the opposite sense: yes means excluded from the bill of materials.
Older instance data
The 10.0 reader still accepts (default_instance (reference "R1") (unit 1) (value "10k") (footprint "")) on a symbol. Reference and unit are read but not used; value and footprint set those fields. The older symbol_instances list is described under instance lists.
Properties
(property [private] "NAME" "VALUE" (at X Y ANGLE)
[(hide yes)] (show_name yes|no) (do_not_autoplace yes|no)
[(effects …)])That is the 10.0 form. KiCad 9.0 puts hide inside effects and writes show_name and do_not_autoplace only when set; both places are read. effects is left out when it holds only defaults. A placed symbol normally has Reference, Value, Footprint, Datasheet and Description, followed by any user fields.
- The name may not be empty. An
(id N)entry from older files is ignored. privatehas effect only on user fields.- In files before version 20250318 a value of
~means empty. - The standard symbol names are matched without regard to case. A second field claiming one of them, or a repeated user field name, is renamed with a suffix
_1,_2and so on. - Sheet fields
Sheet nameandSheet fileare read asSheetnameandSheetfile. The global label fieldIntersheet Referencesis read asIntersheetrefs. - On labels,
Net Classand the translations of it that older versions saved in other interface languages are read asNetclass. - A symbol field
Sim.Enableis not kept: the value0sets exclude from simulation. The still olderSpice_Netlist_Enableddoes the same with the valueN.
Text effects
(effects
(font [(face "NAME")] (size HEIGHT WIDTH) [(line_spacing RATIO)]
[(thickness T)] [(bold yes)] [(italic yes)] [(color R G B A)])
[(justify [left|right] [top|bottom] [mirror])]
[(hide yes)]
[(href "URL")])Colour channels R, G and B are 0 to 255 and A is a fraction. Text is centred where justify does not say otherwise; mirror is accepted and ignored. hide applies to properties: hidden sheet text and labels are made visible. Older files write bold, italic and hide as bare words. A link in href is checked for a valid form. Overbars are written ~{TEXT}; in files before version 20210606 the older ~TEXT~ form is converted in text, labels, sheet pins and Value fields.
Connections
| Item | Contents |
|---|---|
wire, bus | (pts (xy…) (xy…)) with exactly two points, stroke, uuid |
junction | at, (diameter D), (color R G B A), uuid. Zero values mean the default. |
no_connect | at, uuid |
bus_entry | at, (size DX DY), stroke, uuid |
bus_alias | name and (members "…" …). In files before version 20210621 old overbar marks in the names are converted. |
Labels
(label "NET" (at X Y A) [(fields_autoplaced yes)] (effects …) (uuid "…") …properties)
(global_label "NET" (shape input) (at X Y A) …)
(hierarchical_label "NET" (shape output) (at X Y A) …)
(netclass_flag "" (length L) (shape round) (at X Y A) …)The label angle is 0 pointing right, 90 up, 180 left and 270 down. Global and hierarchical labels are written with the shapes input, output, bidirectional, tri_state or passive, and directive labels with dot, round, diamond or rectangle; the reader takes any of these words on all three. shape on text or label is an error. length belongs to directive labels only, and property may not occur on text. A label without properties counts as autoplaced.
KiCad writes a directive label as netclass_flag and its reader also accepts directive_label. An older global label may hold (iref X Y), the position of its list of sheet references; it makes the Intersheetrefs field visible there.
Hierarchical sheets
(sheet (at X Y) (size W H)
(exclude_from_sim no) (in_bom yes) (on_board yes) (dnp no)
[(fields_autoplaced yes)]
(stroke (width W) (type solid)) (fill (color R G B A))
(uuid "…")
(property "Sheetname" "NAME" …)
(property "Sheetfile" "child.kicad_sch" …)
(pin "NET" input (at X Y A) (uuid "…") (effects …)) …
[(instances (project "NAME"
(path "/UUID" (page "2") [(variant …)] …) …) …)])- Only the width and colour of the stroke and the colour of the fill are used.
- The sheet name and sheet file properties are required. In files of version 20200310 the first saved field is the sheet name and the second the file, whatever their names.
- A page number is a string without white space; an empty one becomes
#. - A sheet variant has the form shown under instances and variants. KiCad 10.0 writes only
dnp,exclude_from_sim,in_bomandfieldin it.
A sheet pin matches a hierarchical label of the same name in the child file. Its word is input, output, bidirectional, tri_state or passive. Its angle is 180 on the left edge, 0 on the right, 90 on the top and 270 on the bottom.
Graphics, text and images
| Item | Contents before stroke, fill and uuid |
|---|---|
polyline | (pts …) with at least two points. Two points make a plain drawn line, more make a polygon. In files up to version 20211123 the default line style means dashed. |
arc | (start X Y) (mid X Y) (end X Y) |
circle | (center X Y) (radius R) |
rectangle | (start X Y) (end X Y) [(radius R)]; the radius rounds the corners (new after 9.0) |
bezier | (pts …) with up to four points: start, two control points, end |
rule_area | (exclude_from_sim b) (in_bom b) (on_board b) (dnp b) (new after 9.0) and one (polyline …), read as a closed outline; the stroke, fill and uuid are inside the polyline |
(stroke (width W) (type default|solid|dash|dot|dash_dot|dash_dot_dot) [(color R G B A)])
(fill (type none|outline|background|color|hatch|reverse_hatch|cross_hatch)
[(color R G B A)])KiCad writes the fill colour with color and the three hatch types. The hatch types date from version 20250222. On a sheet shape the reader turns outline into a colour fill in the stroke colour. A missing fill type means none.
Text, text boxes and tables
(text "TEXT" (exclude_from_sim no) (at X Y A) (effects …) (uuid "…"))
(text_box "TEXT" (exclude_from_sim no) (at X Y A) (size W H)
(margins LEFT TOP RIGHT BOTTOM) (stroke …) (fill …) (effects …) (uuid "…"))
(table (column_count N)
(border (external yes) (header yes) [(stroke …)])
(separators (rows yes) (cols yes) [(stroke …)])
(column_widths W …) (row_heights H …)
(uuid "…")
(cells (table_cell "TEXT" (exclude_from_sim no) (at X Y A) (size W H)
(margins L T R B) (span COLS ROWS) (fill …) (effects …) (uuid "…")) …))A table needs at least one cell. Table UUIDs date from version 20250425. Text boxes from KiCad 6.99 development have (start X Y) and (end X Y) and no angle; a box needs end or size, and one without margins gets the old default margin.
Images
(image (at X Y) [(scale S)] (uuid "…") (data "BASE64" …))Image data is a PNG file, or a JPEG file when the picture came from JPEG, in Base64 split into quoted strings of 76 characters. The reader joins the strings, and a result that is not a readable picture is an error. A scale that is not a normal number is read as 1. Files of version 20230121 or older assume 300 pixels per inch, and the reader adjusts the scale.
Groups
(group "NAME" (uuid "…") [(lib_id "LIBRARY:BLOCK")]
(members "UUID" …))A group names items of the sheet by UUID, and groups may contain groups. lib_id links the group to a design block (version 20250513 on). KiCad writes members sorted and leaves out empty groups. See also locked groups.
Instance lists
(sheet_instances (path "/" (page "1")) …)
(symbol_instances
(path "/SHEET-UUIDS/SYMBOL-UUID"
(reference "R1") (unit 1) (value "10k") (footprint "")) …)In sheet_instances, the path / gives the page number of the root sheet (read so from version 20221110). In root files before version 20221002 the paths lack the root UUID, which the reader puts in front.
symbol_instances is the older central list of references, kept at the end of the root file before the data moved into each symbol. KiCad 9.0 and 10.0 do not write it. The reader puts the root UUID in front of each path. When the root file is older than version 20221002, KiCad applies the entries to the symbols of the whole design; files older than 20200828 also get a conversion of their instance data as they are read. A ~ in value or footprint means empty before version 20250318.
Embedded files
(embedded_files
(file (name "part.pdf") (type datasheet)
(data |BASE64
BASE64|)
(checksum "HASH")) …)The types are datasheet, font, model, worksheet and other. The data is compressed with Zstandard and then written as Base64 between two bar characters, in lines of 76 characters. The checksum is a MurmurHash3 value from version 20240819; before that it was a SHA-256 hash. The details are those of embedded files in symbol libraries.
File versions
The number after version is a date in YYYYMMDD form. A program meeting a number newer than it knows should refuse the file, as KiCad does.
| Version | Change |
|---|---|
| 20200310 | First version |
| 20200506 | page renamed to paper |
| 20200512, 20200602 | Exclude from bill of materials; exclude from board |
| 20200608 | Bus and junction properties |
| 20200618 | Duplicate field ids disallowed |
| 20200714 | Alternate pin definitions |
| 20200820, 20200827 | 20200820 has no note; host tag removed |
| 20200828, 20201015 | Footprint in symbol_instances; sheet instance properties |
| 20210123 | Pin type unconnected renamed no_connect |
| 20210125, 20210126, 20210406, 20211123 | UUIDs for pins, labels and wires; a fix to pin UUIDs; schematic UUIDs; junction UUIDs |
| 20210606, 20210615, 20210621 | Overbar changed from ~…~ to ~{…}, then in net names and bus aliases |
| 20220101, 20220102 | Circles, arcs, rectangles, polygons and Béziers; dash-dot-dot lines |
| 20220103, 20220104, 20220124 | Label fields; fonts; netclass_flag to directive_label |
| 20220126, 20220328, 20220331 | Text boxes; their start/end became at/size; text colours |
| 20220404, 20220622 | Default symbol instance data; new simulation model format |
| 20220820, 20220822, 20220903, 20220904 | Instance data fix; hyperlinks; field name visibility; do-not-autoplace |
| 20220914, 20220929 | Do not populate; property ids no longer saved |
| 20221002, 20221004, 20221110, 20221126 | Instance data moved into symbols and sheets; value and footprint removed from it |
| 20221206, 20230121, 20230221 | Simulation fields revised; marker sheet paths; power symbols name the net by value |
| 20230409, 20230620, 20230808 | Exclude from simulation; ki_description became the Description field; Sim.Enable field replaced by the attribute |
| 20230819, 20231120 | Deeper symbol inheritance; generator_version and other changes for KiCad 8 |
| 20240101, 20240417, 20240602, 20240620 | Tables; rule areas; sheet attributes; embedded files |
| 20240716, 20240812, 20240819 | Several net classes per item; net class highlight colour; MurmurHash3 |
| 20241004, 20241209, 20250114 | Boolean hide; private fields; full paths in text cross-references (KiCad 9.0) |
| 20250222, 20250227 | Hatched fills; local power symbols |
| 20250318, 20250425 | ~ no longer means empty text; table UUIDs |
| 20250513, 20250610 | Design block links on groups; do-not-populate and other flags on rule areas |
| 20250827, 20250829 | Custom body styles; rounded rectangles |
| 20250901, 20250922 | Stacked pin notation; variants |
| 20251012, 20251028 | Flat hierarchies; property formatting |
| 20260101, 20260306 | Variant support for boards; corrected sense of in_bom in variants (KiCad 10.0) |
Divergence from spec
- KiCad's developer documentation describes the KiCad 6 files. Later releases add
generator_version, per-symbolinstances, text boxes, tables, rule areas, embedded files and variants. - The documentation gives properties an
(id N)entry. It has not been saved since version 20220929. - The version history in the source says
netclass_flagbecamedirective_label(20220124), but KiCad 9.0 and 10.0 files usenetclass_flagand both words are read. - Locked groups: the KiCad 10.0 writer adds
(locked yes)to a locked group, but the 10.0 schematic reader accepts onlyuuid,lib_idandmembersinside a group and treats any other word as an error. A program reading schematics should acceptlockedthere.
Reading the file
- A schematic begins
(kicad_schfollowed by(version N). - Read the whole file as one S-expression, honouring backslash escapes inside quoted strings. Layout and line breaks carry no meaning.
- A file with a version newer than the reader knows is refused.
- Older files differ:
pageforpaper,(host …)for the generator, asymbol_instanceslist at the end of the root file, and no UUIDs before 20210406. - Since version 20240620 a bar character delimits embedded data; before that it could be part of an unquoted string.
In the explorer
A dropped .kicad_sch file shows its lists as a byte tree and a drawing of the sheet: placed symbols with their units, body styles, rotation and mirroring, fields, wires, buses and bus entries, junctions, no-connect marks, every kind of label and its flag, sheet boxes with their pins, shapes, rule areas, texts, text boxes, tables and bitmap images. Options choose the instance of the sheet, the design variant, hidden pins and fields, the page frame and the size of the picture. A click in the picture selects the bytes of the item.
Tables list the symbols, pins, labels, connections, sheets and sheet pins, instances, page numbers, fields, shapes and texts, table cells, images, the symbols kept in the file, groups, bus aliases and embedded files. Images and embedded files open as files of their own, and the checksum of each embedded file is compared with its data. A sub-sheet is a separate file: its path is shown in the Sheetfile field. Files up to 400 MB are read. With more than 4,096 instance paths, the instance is chosen by number.
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 is drawn in the site’s own stick font, not in KiCad’s stroke font or in the fonts the file names or embeds. It has ASCII, accented Latin letters and some signs; other characters show as boxes.
- Viewer: colours, the placing of texts, fields and pin names, the wrapping of text boxes and the spacing of hatched fills follow KiCad only approximately.
- Viewer: the page frame and title block are a plain version. The drawing sheet and the project settings (junction size, wire hop-overs, references between sheets, default line widths, net class colours and project text variables) are kept outside the schematic and are not read; the junction size and line widths used are fixed defaults.
- Viewer: marks for exclusion from simulation, the bill of materials or the board are listed, not drawn. Bus labels are not coloured as buses, and the marks for unconnected ends are not shown.
- Viewer: jumper pin groups are only in the byte tree, and stacked pin numbers are shown as written.
- Viewer: images other than PNG and JPEG are not drawn.
Links
Software
- KiCad – free electronics design suite (Windows, macOS, Linux)
Developers
- KiCad source code – the schematic reader and writer are in
eeschema/sch_io/kicad_sexpr(C++, GPL)
Reference
- Schematic file format – KiCad developer documentation
- S-expression format introduction – common syntax