DXF vs GDSII
DXF and GDSII are both drawing-interchange formats, but they were built for different domains: DXF is Autodesk's general-purpose CAD drawing format, and GDSII is a purpose-built format for hierarchical integrated-circuit and photomask layout. They differ in geometry model, precision, layering, and hierarchy, which is why files don't move cleanly between them without a dedicated converter.
DXF, GDSII, OASIS, CIF and SVG at a glance
DXF and GDSII aren't the only two layout-adjacent formats worth knowing. Here's how all five that Glyph reads and writes compare on the properties that matter most when moving a design between tools:
| Property | GDSII | OASIS | CIF | DXF | SVG |
|---|---|---|---|---|---|
| Units | Signed 32-bit integers in a fixed database unit (Glyph's default: 1 nm) | Integers in a fixed database unit, like GDSII, in a compact variable-length encoding | Integers; Glyph writes DS n 1 10, so one written unit is 1 nm |
Floating point in a declared drawing unit; the converter writes nm, the editor's Save as… your display unit | Floating point, relative to the viewBox; no engineering unit |
| Hierarchy | Cells placed by SREF and AREF | The same cell and placement hierarchy | DS symbols and calls; Glyph flattens a magnified instance, since a call carries no scale |
BLOCK and INSERT, nestable; Glyph keeps them |
None; Glyph flattens every instance on export |
| Layers | Numbered (layer, datatype) pairs; no names |
(layer, datatype) pairs, plus optional LAYERNAME records, which Glyph reads and writes |
L1D0, or L1D0_METAL for a named layer (KLayout's convention) |
Named layers; Glyph puts the pair in the name: L1D0, or L1D0_METAL for a named layer |
None; Glyph writes each shape's layer colour, so the pair does not round-trip |
| Curves | No arcs; curves are polygons both ways | No arcs; a CIRCLE record is read as a 64-sided polygon, and a round-cap path is written square-capped |
No arcs; a widened path is written as a polygon, a zero-width path as a W centreline |
Native ARC and CIRCLE, but Glyph has no curve model: every curve becomes straight segments |
Native curve commands, but Glyph writes straight segments only |
| Text | TEXT record; PRESENTATION anchoring kept |
TEXT record (string and position); size, font and justification ride as S_GDS_PROPERTY properties |
No text primitive; Glyph writes a 94 label (point and string; size and rotation are dropped) |
TEXT entity |
<text> element, with rotation and mirroring composed in |
| Typical use | The default IC and photomask handoff | The same handoff as GDSII, at a fraction of the file size | Legacy mask-shop and CleWin interchange | CAD drafting; the bridge to mechanical and architectural tools | Publication figures and the web |
What is DXF?
DXF (Drawing Exchange Format) is a CAD drawing-interchange format created by Autodesk for AutoCAD, first released in 1982. It's designed to carry general 2D and 3D drawing data — lines, arcs, circles, polylines, text, dimensions, blocks — between CAD packages, and is widely supported across mechanical, architectural, and general drafting tools. DXF ships in both an ASCII (plain-text) and a binary variant, and its structure is a tagged group-code stream rather than a fixed binary record layout.
DXF vs GDSII: key differences
| Aspect | DXF | GDSII |
|---|---|---|
| Origin / vendor | Autodesk, for AutoCAD (1982) | Calma Company, for GDS II layout systems (late 1970s) |
| Primary domain | General CAD drafting (mechanical, architectural, general drawing) | Integrated-circuit and photomask layout |
| Core geometry | Lines, arcs, circles, and open/closed polylines | Filled boundary polygons and paths (wires); no native arcs — curves are polygonized |
| Units and precision | Floating-point coordinates in a user-chosen drawing unit | Signed 32-bit integer coordinates in a fixed database unit (commonly 1 nm), avoiding floating-point drift |
| Layers | Named, user-defined layers (arbitrary strings), each with its own color/linetype | Numbered (layer, datatype) pairs — a fixed 16-bit layer number and a 16-bit datatype, not names |
| Hierarchy / reuse | Blocks, which can be inserted (and nested) like a lightweight instance | Structures (cells), placed via SREF (single instance) or AREF (regular array), forming a true hierarchical DAG |
| Curves/arcs | Native arc and circle entities | No arc primitive — a circle or curved edge is represented as a many-sided polygon approximation |
The practical upshot: DXF's named layers and native arcs suit drafting workflows where a human names things and curves matter, while GDSII's numbered layers, integer coordinates, and array references suit dense, hierarchical mask data where a single repeated cell (e.g. a memory bitcell) might be instanced millions of times.
Converting between DXF and GDSII
Need a quick conversion? Convert DXF to GDSII or GDSII to DXF in the free browser-based converter — no upload, no installation, runs entirely in your browser — and an AutoCAD drawing still in its native format can go straight from DWG to GDSII with no DXF export step, or use the general-purpose DXF converter if your target format isn't GDSII. Need to edit rather than just convert? See the free DXF editor page for what that covers. Need more control? Read on.
Because the two formats model geometry differently — arcs vs polygonized curves, named layers vs numbered layer/datatype pairs, floating-point vs fixed integer units — converting between them is a lossy or approximating operation, not a re-encoding. Arcs typically need to be segmented into polygons (or vice versa, approximated) during conversion, and named DXF layers need an explicit mapping to numbered GDS layers.
DXF → GDSII is the easier direction, and Glyph does it natively: open the .dxf file, review the imported geometry and layer mapping, then save as .gds. No separate converter step is required.
GDSII → DXF is a direction Glyph covers directly, via (see below). Whatever tool you use, check what it does with arcs, units, and layer mapping before trusting a converted file — defaults vary, and a mismatch there is a common source of geometry errors.
Does Glyph support DXF?
Yes, in both directions. On import, Glyph converts a DXF into editable, hierarchical geometry — lines, polylines (including bulge arcs), circles, arcs, ellipses, splines, hatch boundaries, and text all become native shapes, with DXF BLOCK/INSERT mapped onto Glyph cells and SREF/AREF instances so the hierarchy survives rather than flattening. Glyph reads both the ASCII and the binary DXF variant, detecting which one a file is from its own bytes — there's no re-save step. Drawing units come from the file's $INSUNITS header; a file that declares none makes Glyph ask which unit it is in (suggesting millimetres when its $MEASUREMENT says metric), and the online converter reads such a file as 1 unit = 1 µm and says so. Imported layers default to hollow outlines since DXF drawings are usually line art rather than filled mask regions. (.dxb is a different format from binary DXF — a compact opcode-based plotting format, not DXF group codes — and isn't supported; export DXF from your CAD tool instead.)
On export, writes DXF R2000 (AC1015) in the unit you work in — nanometres, micrometres or millimetres, declared in $INSUNITS — while the converter writes 1 drawing unit = 1 nm ($INSUNITS = 12), so its coordinates stay exact integers. Because DXF has no datatype concept, the GDSII (layer, datatype) pair is encoded in the DXF layer name (L1D0, or L1D0_METAL for a named layer) rather than silently merging 1/0 with 1/4. Output is checked against ezdxf's auditor on every build, so a DXF Glyph writes is validated by an implementation that shares no code with it.
Further reading
- Autodesk, DXF Reference (AutoCAD 2018) — help.autodesk.com/cloudhelp/2018/ENU/AutoCAD-DXF/files/index.htm. The vendor's own format reference.
- Wikipedia, "GDSII" — en.wikipedia.org/wiki/GDSII. Background on the mask-layout format.
- W3C, Scalable Vector Graphics (SVG) 1.1 — w3.org/TR/SVG11/. The format Glyph uses as its vector import/export bridge.
Open a .gds file directly in Glyph — nothing to install, and your files never leave your computer. Once a design is in GDSII, see maskless lithography for how it gets exposed without a physical photomask.
Frequently asked questions
What's the main difference between DXF and GDSII?
DXF is Autodesk's general-purpose CAD drawing format, built around lines, arcs, circles, text and dimensions in a floating-point drawing unit. GDSII is a purpose-built hierarchical format for integrated-circuit and photomask layout, using signed 32-bit integer coordinates in a fixed database unit and numbered (layer, datatype) pairs instead of named layers.
Does converting DXF to GDSII preserve hierarchy?
Yes. DXF's BLOCK/INSERT structures map onto GDSII cells and SREF/AREF instances, and Glyph preserves that hierarchy rather than flattening it, on both import and export. The one approximation is scale — a GDSII instance carries a single uniform magnification, so an INSERT with different X and Y scale factors is imported at its X scale, and Glyph warns when that happens.
Does GDSII support arcs and circles the way DXF does?
No. DXF has native ARC and CIRCLE entities, but GDSII has no arc primitive at all, and Glyph's own internal shape model has none either — every curve, from either format, is stored and exported as straight segments — a CIRCLE becomes a polygon outline, while an open ARC becomes a polyline path.
Which direction is easier, DXF to GDSII or GDSII to DXF?
DXF to GDSII is the more direct direction — Glyph opens the .dxf file, and you review the imported geometry and layer mapping before saving as .gds, with no separate converter step. Glyph also writes GDSII to DXF directly, via .
Is my file uploaded anywhere when converting between DXF and GDSII?
No. Both directions run entirely inside your browser tab, using the same reader and writer as the Glyph editor — there is no server involved and your file never leaves your machine.