Introduction
Before version 6.0, the circuit board program EAGLE, made by CadSoft and later sold by Autodesk, saved binary files. No published specification was found. This page describes board files as the free editor pcb-rnd reads them; it covers files of versions 3, 4 and 5. Version 6.0 replaced the format with the EAGLE XML design file.
Identification
| First two bytes | Taken as |
|---|---|
10 00 | EAGLE 4 or 5 |
10 80 | EAGLE 3 |
Two bytes make a weak test. A stricter one also checks that the record count at offset 4 fits in the file and that the records which follow have known codes. Bytes 8 and 9 of the first record hold the version, major then minor.
File layout
- A tree of records, each exactly 24 bytes.
- A block of long strings.
- In versions 4 and 5, the design rules.
Integers are little-endian. Byte 0 of a record is its code and byte 1 holds flag bits, so a reader compares byte 1 only after masking it. Coordinates and lengths count units of 0.1 µm.
Tree
The first record is the drawing, code 10. The 32-bit number at offset 4 is the number of
records in the whole tree. Records are stored depth first: a parent, then its children. A parent
gives a count of one of two kinds. A direct count is the number of immediate children. A
total count is the number of records in everything below that section.
| Parent | Counts (offset, size, kind) |
|---|---|
| Drawing | 4, 4: total, counting the drawing record itself |
| Schematic | 4, 4: direct |
| Library | 4, 4: device sets, total; 8, 4: symbols, total; 12, 4: packages, total |
| Device, symbol or package list in a library | 4, 4: devices direct, symbols and packages total |
| Board, in this order | 12, 4: libraries, total; 2, 2: plain drawing, direct; 16, 4: elements, total; 20, 4: signals, total |
| Signal, symbol, polygon, element, instance, sheet net, path, part, package variant, schematic sheet | 2, 2: direct |
| Package | 2, 2: total |
| Device set entry | 2, 2: gates; 4, 2: package variants; both total |
Record codes
| Code | Record | Code | Record |
|---|---|---|---|
10 | drawing | 2A | pad |
11 | not known | 2B | surface pad |
12 | grid | 2C | pin |
13 | layer | 2D | gate |
14 | schematic | 2E | element |
15 | library | 2F | element name and value |
17 | device list | 30 | instance |
18 | symbol list | 31 | text |
19 | package list | 33 | net or bus label |
1A | schematic sheet | 34, 35 | moved name text, moved value text |
1B | board | 36 | package variant |
1C | signal | 37 | device set entry |
1D | symbol | 38 | part |
1E | package | 3A | schematic bus |
1F | schematic net | 3C | variant connections |
20 | path | 3D | schematic connection |
21 | polygon | 3E | contact reference |
22 | wire | 3F, 40 | moved part text, moved gate text |
24 | arc | 41 | attribute |
25 | circle | 42 | attribute value |
26 | rectangle | 43 | frame |
27 | junction | 44 | moved cross reference |
28 | hole | 53 | a leaf of unknown meaning; a leaf starting 2D 84 also occurs |
29 | via |
Record fields
Offsets are within the 24-byte record. “@12:2” means two bytes at offset 12. A field named “half” is stored as half the real value. Strings are given as offset and length.
Drawing settings
| Record | Fields |
|---|---|
| grid | display bit 01 and visible bit 02 @2; unit bits 0–3 and second unit bits 4–7 @3; multiple @4:3; size, 64-bit float @8; second size, 64-bit float @16 |
| layer | side bit 10, visible bits 2–3, active bit 02 @2; number @3; linked layer @4; fill bits 0–3 @5; colour bits 0–5 @6; name @15:9 |
| schematic | sheet count @8:4; attribute count @12:4 (zero in version 4); cross reference format string @19:5 |
Graphics
| Record | Fields |
|---|---|
| wire | layer @3; x1 @4:4, y1 @8:4, x2 @12:4, y2 @16:4; half width @20:2; style and cap bits (mask 33) and clockwise bit 20 @22; line type @23 |
| circle | layer @3; x @4:4, y @8:4, radius @12:4; half width @20:4 |
| rectangle | layer @3; x1, y1, x2, y2 @4, @8, @12, @16, each 4; rotation @20:2 |
| polygon | bounding box @4, @6, @8, @10, each 2; width @12:2; spacing @14:2; isolate @16:2; layer @18; at @19: pour bit 01, rank bits 1–3, thermals bit 80, orphans bit 40 |
| frame | layer @3; x1, y1, x2, y2 @4 to @16; columns @20; rows @21; borders @22 |
| junction | layer @3; x @4:4, y @8:4; width value @12:2 |
| hole | x @4:4, y @8:4; half drill @12:2 |
| text, labels, attributes and moved texts | layer @3; x @4:4, y @8:4; size @12:2 (half size in the text record); ratio bits 2–6 @14; rotation bits 0–11, mirrored bit 12, spin bit 14 of the 16-bit value @16; string @18:5 |
| attribute value | symbol string @2:5; attribute string @7:17 |
Board
| Record | Fields |
|---|---|
| board | bounding box @4, @6, @8, @10, each 2; counts as in the tree table |
| signal | bounding box as above; airwires bit 02 @12; net class low nibble @13; name @16:8 |
| contact reference | element number @4:2; pin number @6:2 |
| via | shape @2; x @4:4, y @8:4; half drill @12:2; half diameter @14:2; layers code @16; stop bit 01 @17 |
| element | x @4:4, y @8:4; library number @12:2; package number @14:2; rotation bits 0–11 @16; mirrored bit 10 and spin bit 40 @17 |
| element name and value | name @2:8; value @10:14 |
Library
| Record | Fields |
|---|---|
| library | counts as in the tree table; name @16:8 |
| device list, symbol list | library name @16:8 |
| package list | description @10:6; library name @16:8 |
| package | bounding box @4 to @10; description @13:5; name @18:6 |
| symbol | bounding box @4 to @10; name @16:8 |
| pad | shape @2; x @4:4, y @8:4; half drill @12:2; half diameter @14:2; rotation @16:2; stop 01, thermals 04, first 08 @18; name @19:5 |
| surface pad | roundness @2; layer @3; x @4:4, y @8:4; half width @12:2; half height @14:2; rotation bits 0–11 @16; stop 01, cream 02, thermals 04, first 08 @18; name @19:5 |
| pin | function bits 0–1 and visible bits 6–7 @2; x @4:4, y @8:4; direction bits 0–3, length bits 4–5 and rotation bits 6–7 @12; swap level @13; name @14:10 |
| device set entry | gate count @2:2; variant count @4:2; prefix @8:5; description @13:5; name @18:5 |
| gate | x @4:4, y @8:4; add level @12; swap level @13; symbol number @14:2; name @16:8 |
| package variant | package number @4:2; pin-to-pad table @6:13; name @19:5. Variant connection records continue the table. |
Schematic
| Record | Fields |
|---|---|
| schematic sheet | bounding box @4 to @10; part, bus and net counts @12, @16, @20, each 4 |
| part | library @4:2; device @6:2; variant @8; technology @9:2; name @11:5; value @16:8 |
| instance | x @4:4, y @8:4; placed @12:2; gate number @14:2; rotation bits 10–11 and mirrored bit 12 of the 16-bit value @16; moved-text bit 01 @18 |
| schematic net | bounding box @4 to @10; net class low nibble @13; name @18:6 |
Rotation and arcs
- A rotation value of 1024 or more means 360 × value ⁄ 4096 degrees.
- pcb-rnd reads a smaller, non-zero value, as version 3 writes it, as (value AND
F0) × 90 degrees. - Mirrored and spin bits correspond to the
MandSletters of the XML form.
A wire with line type 0 is straight and uses the fields above. Line types 78 to
7F, and arc records with type 1 to 8, are arcs whose centre lies at a corner or the middle
of a side of the box around the two end points:
| Arc type | Centre | Start, sweep (degrees) |
|---|---|---|
| 1 | minimum x, minimum y | 180, 90 |
| 2 | maximum x, minimum y | 270, 90 |
| 3 | maximum x, maximum y | 0, 90 |
| 4 | minimum x, maximum y | 90, 90 |
| 5 to 8 | the four middle points | 90, 180; 270, 180; 180, 180; 0, 180 |
Line type 81, or arc type 0, is a general arc. x1, y1, x2 and y2 are then 3-byte values at
offsets 4, 8, 12 and 16. One centre coordinate c is made of the bytes at 7, 11 and 15. Byte 19
gives signs: 01 for c, 02 x1, 04 y1, 08 x2,
10 y2. With (mx, my) the middle of the chord:
- if |x2 − x1| < |y2 − y1|, c is the centre x, and cy = (mx − cx) × (x2 − x1) ⁄ (y2 − y1) + my
- otherwise c is the centre y, and cx = (my − cy) × (y2 − y1) ⁄ (x2 − x1) + mx
Long strings
After the tree comes a block that starts with an 8-byte preamble: the bytes 13 12, and at
offset 4 a 16-bit length. NUL-terminated strings follow, ending with an empty string, then four more
bytes. A string field in a record whose first byte is 7F does not hold text: it stands for
the next string of this block, taken in order.
Design rules
Versions 4 and 5 add a block that begins 10 04 00 20. A text preamble follows, ending with
00 78 56 34 12, then 244 bytes of values. Offsets below are within those bytes. Version 3
files have no such block.
| Offset | Type | Values |
|---|---|---|
| 0–32 | 32-bit integers | copper spacing: wire–wire (0), wire–pad, wire–via, pad–pad, pad–via, via–via, pad–surface pad, via–surface pad, surface pad–surface pad (32) |
| 44, 52 | 32-bit integers | copper to board outline; drill to hole |
| 64, 68 | 32-bit integers | minimum width; minimum drill. Dividing by 254 gives mils. |
| 84–132 | 64-bit floats | ring ratios: pad top (84), inner (92), bottom (100), via outer (108), via inner (116), micro via outer (124), micro via inner (132) |
| 140–192 | 32-bit integers | fourteen minimum and maximum ring limits |
| 196, 200, 204 | 32-bit integers | pad shapes: top, bottom, first |
| 208, 216 | 64-bit floats | two further ratios |
| 224–236 | 32-bit integers | solder mask limits |
Not described
Known, not yet covered
- Reference: the order of the 22 bytes of pin and pad numbers in variant connection records is only partly given by the source.
Unknown
- Reference: schematic (
.sch) and library (.lbr) files: pcb-rnd imports boards only, and the fields of schematic buses and connections are not decoded. - Reference: record
11, the leaves53and2D 84, and all bytes of a record not listed above. - Reference: the meaning of the flag bits of byte 1, of the coded values (grid units, shapes, line style and cap, via layers, pin and gate settings, layer fill and colour) and of several design rule values.
- Reference: the layout of files older than version 3, and what differs between versions 4 and 5.
Variants
- EAGLE XML design file – boards, schematics and libraries of EAGLE 6.0 and later
- EAGLE binary board – boards of EAGLE 3, 4 and 5
Links
Software
- pcb-rnd – free board editor that reads binary and XML EAGLE boards (Linux and other Unix systems)
Developers
- pcb-rnd io_eagle – reader of the binary records, under the GNU GPL (C)
Reference
- pcb-rnd, eagle_bin.c and read.c – source of the record table, tree rules, strings, arcs and design rules on this page
- KiCad developer documentation: EAGLE – states that XML began with version 6.0