English | 中文
Convert KiCAD project files to the eprj3 project format of EasyEDA Pro, and KiCad libraries to the EasyEDA Pro library format .elibz2.
- Project conversion: Batch-traverses all
.kicad_sch/.kicad_pcbfiles under a directory and generates a complete eprj3 folder project (<name>.eprj3index +sch/+pcb/) - Library conversion: Packs all KiCad libraries under a directory (
*.kicad_symsymbol libs +*.pretty/*.kicad_modfootprint libs) into a single EasyEDA Pro library file.elibz2 - No-install browser version:
kicad-to-eprj3.htmlconverts projects entirely in the browser (no Node.js, no upload) - Standalone JS: one file usable both as a Node.js CLI and as a browser script, built by
npm run build
- Node.js ≥ 18. There are no npm dependencies (runtime or development); the browser page needs none either.
Download kicad-to-eprj3-<version>.zip from the GitHub Releases page and unzip it. Open kicad-to-eprj3.html in a recent Chrome/Edge:
- Add one or more KiCad project folders. Clicking a folder scans it and lists the projects inside, so several can be ticked at once; multiple folders can also be dropped together, and the picker can be used repeatedly.
- Click Convert — everything is processed locally; nothing is uploaded.
- Download the
.eprj3.zip, unzip it, then open<project>/<project>.eprj3in EasyEDA Pro.
Choosing a folder uses the browser's File System Access API, so no “upload files” confirmation appears (Chrome/Edge).
The zip also contains the standalone JS, this guide (bilingual) and the license.
The page is also published as a single-page site: https://easyeda.github.io/kicad-to-easyeda-eprj3/
.github/workflows/pages.yml builds dist/kicad-to-eprj3.html and deploys it as the Pages index.html on every push to main (or manually via Actions → Deploy browser page to GitHub Pages → Run workflow). In a fork, enable Settings → Pages → Build and deployment → Source: GitHub Actions once; the workflow can also try to enable it on the first run.
If your organization disables GitHub Pages for the repository, the workflow detects it and skips deployment with a notice (no red build). The same single file is also attached to every GitHub Release — download
kicad-to-eprj3.htmland open it locally, or host it on any static file server. No build step is needed to use it.
node scripts/convert-kicad.js convert <KiCad project directory> <output directory> [--project-name <name>]
Example — convert the sample project shipped with this repository:
node scripts/convert-kicad.js convert example/kicad/kicad-project ./eprj3 --project-name kicad-project
Output:
Created eprj3 project at D:/…/eprj3
sch: kicad-project.kicad_sch -> D:/…/eprj3/sch/Schematic1/P1.esch2
pcb: kicad-project.kicad_pcb -> D:/…/eprj3/pcb/PCB1.epcb2
The generated project (<output directory>/kicad-project.eprj3, containing sch/ and pcb/) can be opened directly in EasyEDA Pro.
- The two directories are passed positionally: 1st is the KiCad project directory, 2nd is the eprj3 output directory
- Each
*.kicad_schunder the source directory generates one schematic (Schematic1,Schematic2, …), and each*.kicad_pcbgenerates one board (PCB1,PCB2, …)
node scripts/convert-kicad-lib.js convert <KiCad library directory> <output.elibz2> [--name <LibName>]
Example — put symbol and footprint libraries into one directory and pack them together (the scan is non-recursive; .kicad_sym files and .pretty/ directories must be direct children):
mylibs/
├── Device.kicad_sym
├── LED.kicad_sym
├── Resistor_SMD.pretty/
│ ├── R_0805_2012Metric.kicad_mod
│ └── …
└── LED_SMD.pretty/
└── …
node scripts/convert-kicad-lib.js convert mylibs ./DeviceLED.elibz2 --name DeviceLED
Output:
sym lib: Device.kicad_sym (533 symbols)
sym lib: LED.kicad_sym (63 symbols)
footprint lib: LED_SMD.pretty (100 footprints)
footprint lib: Resistor_SMD.pretty (67 footprints)
Wrote DeviceLED.elibz2: 596 symbols, 167 footprints (636245 bytes)
The resulting DeviceLED.elibz2 can be installed into your local libraries through EasyEDA Pro's library import.
- Scans the directory for all
*.kicad_sym(symbol libraries) and*.pretty/(footprint libraries, reading their*.kicad_modfiles) and merges everything into one.elibz2 --name(optional): overrides the package name (defaults to the output file name minus the.elibz2suffix)- A
.elibz2is a zip archive containing:device2.json— device/symbol/footprint index (uuid → metadata); symbols carrydocType:2, footprintsdocType:4, and every symbol gets an auto-generated device entry<LibName>.elibu— a record stream (same format as.esch2/.epcb2); each symbol/footprint is written as two segments:DOCHEAD+METAandDOCHEAD+records
- When a symbol's
Footprintproperty (e.g.Resistor_SMD:R_0805) matches a converted footprint name, the device'sFootprintattribute is automatically linked to that footprint's uuid - Power symbols (
symbol_type "power") get METAdocType:18; footprint docs include the 19-layer table +ACTIVE_LAYER+ a fullCANVASand carry noPARTrecord - Example:
example/easyeda/easyeda-pro-libs.elibz2is a reference library package exported from EasyEDA Pro
Build the distributable artifacts with:
npm run build
This writes to dist/:
| File | Purpose |
|---|---|
kicad-to-eprj3-<version>.js |
Single-file UMD bundle: Node CLI and browser API |
kicad-to-eprj3.html |
Self-contained conversion page (bundle inlined) |
README.md |
Bilingual end-user guide shipped in the zip |
kicad-to-eprj3-<version>.zip |
The three files above + LICENSE |
The standalone JS works exactly like the multi-file CLI:
node dist/kicad-to-eprj3-<version>.js convert <KiCad project directory> <output directory> node dist/kicad-to-eprj3-<version>.js convert-lib <KiCad library directory> <output.elibz2>
In a browser it exposes window.KicadToEpj3 (convertProjectFiles, zipProject, zipStore, …).
Versioning / release: the build workflow (.github/workflows/build-release.yml, manual workflow_dispatch) bumps the version (default: patch / last digit), runs the tests, builds the artifacts, commits the bump to main, tags v<version> and attaches the zip to the GitHub release. Every update must bump the last digit (node build/version.js patch, or npm run version:bump). The workflow needs permission to push to main (allow GitHub Actions in the branch protection rules if the push is rejected).
Output strictly follows the official format documentation from easyeda-format-skill (types / field definitions / JSON Schemas), calibrated against real exported data where the schemas diverge from actual app output; see also the official eprj3 format example project:
| KiCad | eprj3 |
|---|---|
lib_symbols (schematic-embedded symbol libs) |
Embedded SYMBOL doc segments (PART/graphics/pins) + DEVICE doc segments in .esch2 |
symbol instances (with property, mirror) |
COMPONENT (partId → embedded PART, DeviceName → DEVICE, mirror/rotation converted) + Designator/Value ATTR |
wire |
WIRE + multiple LINE records sharing a lineGroup |
bus / bus_entry |
BUS + LINE / BUSENTRY |
junction |
Wire split/grouping point only (same lineGroup); no dot is drawn |
no_connect |
Two LINE records (X marker) |
label / global_label / hierarchical_label |
NET attr on the wire group / net flag / net port |
text / text_box |
TEXT (+ RECT border) |
polyline / rectangle / circle / arc / bezier |
POLY / RECT / CIRCLE / ARC (center from three points) / BEZIER, with stroke/fill styles mapped |
image |
OBJ (base64-embedded) |
sheet (hierarchy) |
Reuse block symbol (SYMBOL docType 17) + COMPONENT, linked to its own child schematic (CBB instances) |
power symbol / PWR_FLAG |
Net flag (docType 18) / non-electrical symbol (docType 21, no PIN, keeps the KiCad glyph) |
| Pin electrical/graphic types | Numeric PIN.electric / PIN.pinShape mapping |
footprint (with pad) |
Embedded FOOTPRINT doc segments (PART/PAD/silkscreen graphics) + DEVICE doc segments + COMPONENT placements + Designator/Footprint/Device ATTR in .epcb2 |
| pad nets / oval drills | PAD_NET (component-pad binding) + NET index records / holeType ROUND width×height |
segment / arc (PCB traces) |
FILL on the corresponding layer (straight tracks as closed thin polygons; track arcs as closed polygons with ARC segments) |
via |
VIA (net, hole and pad diameters) |
zone |
POUR (pourType/keepIsland) + one POURED per zone/layer (pourFill, head id linked to the POUR); keepouts → REGION (regionType PROHIBIT + prohibitType) |
dimension (aligned/orthogonal/radial/leader) |
DIMENSION (dimensionType LENGTH-CONSTRAINT + controlDot) |
gr_line / gr_arc / gr_rect / gr_poly / gr_circle / bezier |
LINE / ARC / closed POLY (circles as ["CIRCLE",…] paths, beziers as "C"-segment paths) |
gr_text |
STRING (alignment origin, mirroring, knockout→reverse) |
gr_rect/gr_line/gr_arc/gr_poly on Edge.Cuts |
Stitched into POLY BOARD_OUTLINE (layerId=11) |
| Layer mapping | F.Cu=1, B.Cu=2, F.SilkS=3, B.SilkS=4, F.Mask=5, Edge.Cuts=11, In{n}.Cu=14+n…; the PCB doc carries the official 60-layer table and enables the inner layers the KiCad stack actually uses (use/show), so their tracks and pours are not dropped |
- Unit conversion: KiCad mm → eprj3 mil (×39.3700787); axis flip: KiCad Y-down → eprj3 Y-up; rotation (360−deg)%360
- FOOTPRINT documents for bottom-side components are stored top-canonical (F/B copper/silk layers swapped, footprint-local Y mirrored); the client mirrors the document when placing the COMPONENT, so pads land on the correct side and asymmetric pad coordinates are not permuted
- uuid linkage (official convention): the
DOCHEAD.uuidof the.esch2page /.epcb2/.ecfgequals thesheets/pcbs/schematicsuuid in the index respectively - Also generates
sch/<name>/<name>.ecfg(design-rules skeleton) and.evar(assembly variants, empty) - Not migrated: 3D models, net classes, SPICE models, custom rules; elements that cannot be translated are skipped with a warning
| KiCad library | .elibz2 |
|---|---|
Every (symbol …) in a *.kicad_sym |
SYMBOL doc segment (PART/PIN/POLY/RECT/CIRCLE/ARC/BEZIER) + a device2.json symbol index entry + a device entry |
symbol_type "power" |
META docType:18 (power class) |
Symbol property entries (other than Reference/Value) |
Passed through into device attributes |
Symbol Footprint property |
Auto-written to the device's attributes.Footprint (uuid) when it matches a footprint name |
Every (footprint …) in *.pretty/*.kicad_mod |
FOOTPRINT doc segment (19-layer table + PAD/POLY/ARC + ACTIVE_LAYER) + a device2.json footprint index entry |
pad thru_hole/oval drills |
PAD holeDiameter/holeWidth/holeType ROUND |
F.SilkS/B.SilkS graphics |
layerId 3/4; Fab/CrtYd/Dwgs and the rest → Document layer 13 |
kicad-to-easyeda-eprj3/
├── scripts/
│ ├── convert-kicad.js ← Project CLI wrapper
│ ├── convert-kicad-lib.js ← Library CLI wrapper
│ ├── browser/
│ │ ├── entry.js ← Standalone bundle entry (Node CLI + browser API)
│ │ ├── vfs.js ← In-memory filesystem used by the browser page
│ │ ├── active-fs.js ← Active filesystem switch for one conversion
│ │ ├── node-fs.js / node-path.js ← Host Node fs/path injected by the bundle
│ │ ├── node-shims/ ← fs/path/crypto/zlib facades for browsers + Node
│ │ └── zip-store.js ← Dependency-free STORE-mode ZIP writer for downloads
│ └── lib/
│ ├── convert-project.js ← Project conversion flow (shared by CLI + bundle)
│ ├── convert-lib.js ← Library conversion flow (shared by CLI + bundle)
│ ├── kicad.js ← KiCad S-expression parser
│ ├── kicad-to-eprj3.js ← Symbols/footprints → eprj3 records
│ ├── schematic-convert.js ← Schematic page conversion (symbols/net flags/net ports/hierarchy/frame)
│ ├── pcb-convert.js ← PCB conversion (tracks/vias/footprints/pours/stackup/design rules)
│ ├── convert-util.js ← Shared conversion constants and helpers
│ ├── frame-template.js ← A4 drawing-sheet template instantiation
│ ├── eprj3.js ← eprj3 read/write core (from easyeda-eprj3-skill, corrected against the official example)
│ ├── elibz2.js ← .elibz2 package assembly (device2.json + .elibu)
│ ├── zip.js ← Dependency-free zip read/write (zlib deflate/store)
│ └── utils.js
├── build/
│ ├── bundle.js ← Builds the standalone JS, HTML page and zip
│ ├── version.js ← Version bump (patch/minor/major/none)
│ ├── check-licenses.js ← Enforces MIT/Apache-2.0 for every dependency
│ ├── licenses/ ← MIT license texts shipped in the zip
│ ├── app.html ← Browser page template
│ └── artifact-readme.md ← Bilingual end-user guide shipped in the zip
├── .github/workflows/
│ ├── build-release.yml ← Manual build → version bump → tag → release asset
│ └── pages.yml ← Push to main → build the single-page site for GitHub Pages
├── example/
│ ├── easyeda/ ← Reference EasyEDA Pro library package easyeda-pro-libs.elibz2
│ └── kicad/ ← Sample KiCad project
└── test/
├── smoke.js ← End-to-end smoke suite (165 assertions)
├── bundle.test.js ← Standalone bundle / browser API / HTML tests (23 assertions)
├── ui.test.js ← Browser page folder-scan / multi-select / modal tests (11 assertions)
├── compare/ ← KiCad ↔ eprj3 comparison (netlist/BOM/PCB primitives/stackup/ratlines)
└── validate-format.js ← Format validator checking generated records against the official JSON Schemas
npm test # license check + smoke + hostpath + standalone bundle + UI tests npm run build # dist/kicad-to-eprj3-<version>.{js,zip} + kicad-to-eprj3.html
Generated records can additionally be validated one by one against the official Schemas (sch/pcb/lib contexts; lib routes each doc's records by its docType):
node test/validate-format.js <generated .esch2|.epcb2|.elibu> <sch|pcb|lib>
The validator uses
validate.jsfrom easyeda-format-skill, located in the sibling directory (or via theEASYEDA_FORMAT_SKILLenvironment variable) when present; it is not vendored. Note: the official Schemas slightly diverge from real app exports (e.g.POUR.pourType, PCBATTR.groupID, theDIMENSIONstructure); the validator is calibrated to the real exported data.
- easyeda-format-skill — The EasyEDA Pro file format skill pack (type index, per-primitive field definitions, JSON Schemas, validate.js); the authoritative format reference for this repository
- easyeda-eprj3-skill — A skill pack that teaches AI coding assistants to generate
.eprj3projects from scratch;scripts/lib/eprj3.jsandutils.jsin this repository come from that project's core library - easyeda-eprj3-format — Official eprj3 format example project
Third-party components are all MIT-licensed (the vendored eprj3.js / utils.js core; full text under build/licenses/). The project deliberately avoids npm dependencies — npm run license:check (part of npm test) enforces that any dependency is MIT or Apache-2.0.