Convert DWG to DXF for mask and lithography geometry
This is a geometry-scoped conversion, not a general AutoCAD-fidelity DWG-to-DXF pass.
Your DWG is decoded, re-modelled as mask geometry, and written back out as a DXF built for photomask and lithography tooling. Concretely, that means the output contains only TEXT, LWPOLYLINE and INSERT entities; every arc, circle, ellipse, spline, hatch and solid arrives flattened to a polyline; layers are renamed to encode a (layer, datatype) pair as L1D0; one drawing unit is exactly 1 nm ($INSUNITS = 12); and layer colours are quantised to the AutoCAD Color Index. If that is what your exposure tool or mask shop wants, this is the right conversion. If you need the original entity types back for CAD work, export DXF from the tool that wrote the DWG instead.
Everything runs inside your browser — the DWG is decoded locally, and there is no server to upload it to.
How to convert DWG to DXF
- Drop your
.dwgfile onto the converter on this page. Containers from R14 through R2018 are recognised from the file's own magic bytes. - Confirm the drawing unit, then pick DXF as the target format. The unit you confirm here sets the physical scale; the output itself is always written at 1 unit = 1 nm. Switch on close open contours if your drawing is line art rather than filled regions.
- Download the
.dxffile. Open it in the free Glyph editor first if you want to check layers and outlines before it reaches an exposure tool.
What survives and what changes
The conversion is two steps — DWG in, DXF out — so both halves' behaviour applies.
Reading the DWG
| Aspect | What happens |
|---|---|
| Containers | R14 → R2018 (AC1014, AC1015, AC1018, AC1021, AC1024, AC1027, AC1032), including R2007's separate page and compression scheme. |
| Entities read | LINE, CIRCLE, ARC, ELLIPSE, LWPOLYLINE, POLYLINE_2D with its VERTEX records, SPLINE, POINT, INSERT, HATCH, SOLID, TRACE, 3DFACE, TEXT, ATTRIB, ATTDEF and MTEXT. |
| DIMENSION | Not decoded. Export DXF from your CAD tool if a drawing is only dimensions. |
| HATCH | Reduced to its boundary loops — a hatch is treated as fill intent, not as pattern geometry. |
| Splines | Both control-point and fit-point representations decode and flatten. A fit-point spline's sampled curve is visually close rather than proven identical to the original CAD tool's. |
| Widened polylines | Constant width and per-vertex widths are read, so a widened track keeps its width instead of collapsing to a hairline. |
| Units | $INSUNITS is offered as a preset only when the header could be read with confidence, and you confirm it — a wrong scale on correct geometry is the most expensive silent error in CAD import. |
| Undecodable data | Counted and reported, never silently swallowed. |
Writing the DXF
| Aspect | What happens |
|---|---|
| Entities written | Only TEXT, LWPOLYLINE and INSERT. This is the scope stated at the top of the page, not a defect. |
| Curves | None survive as curves. Every arc, circle, ellipse and spline is already a polyline by the time the writer runs, because the intermediate model is mask geometry. |
| Units | 1 drawing unit = 1 nm, $INSUNITS = 12, $MEASUREMENT = 1. Coordinates are exact integers at that scale. |
| Layer names | Rewritten to encode a (layer, datatype) pair (L1D0), sanitised to characters AutoCAD accepts and de-duplicated. Original DWG layer names are not carried through. |
| Layer colours | Quantised to the nearest AutoCAD Color Index. A hidden layer is written with a negative ACI, DXF's "layer is off", never dropped. |
| Hierarchy | Blocks survive as blocks: each cell becomes a DXF BLOCK, an insert becomes an INSERT carrying magnification, rotation and mirroring. |
| Axis-aligned arrays | Written as a single INSERT with DXF's column/row array groups — one entity, however large the array. |
| Other arrays | Expanded instance by instance up to 20 000 instances; past that only the four corner instances are written and a 999 comment in the file says so. |
| Paths | A widened path becomes a constant-width LWPOLYLINE. End-cap style has no DXF equivalent and is lost — the result is always flush-capped. |
| Text | A plain TEXT entity in the Standard style. Font, letter spacing and justification collapse into the resolved anchor offset. |
| Validation | The DXF writer is checked on every build against ezdxf, an implementation that shares no code with Glyph, with repairs treated as failures and three negative controls that must fail. |
Why a converted CAD outline sometimes exposes nothing
A mask writer exposes regions — closed polygons with area. CAD outlines are frequently drawn as separate LINE, ARC and SPLINE entities that merely touch end to end, sometimes with a sub-micron gap. Converted literally, each becomes a zero-width path: a centreline, geometrically correct and completely non-exposing. The file opens cleanly, the picture looks right, and the mask comes out blank.
The close open contours option chains touching segments into closed rings, per (layer, datatype) pair and never across layers, with a default join tolerance of 100 nm. A chain that still does not close is force-closed only when it encloses real area (default 10 µm²). Keying the decision on enclosed area rather than on gap size is what lets a sloppy gap in a genuine outline close while a leader line or centreline — open by nature, enclosing nothing — stays open instead of becoming a slit of exposed resist. Nothing is ever deleted: chains that stay open keep the paths they came from.
Why the scope is what it is
DWG and DXF share one entity model — a general drafting model with named layers, native arcs and floating-point coordinates in a user-chosen unit. Mask and lithography tooling wants something narrower: closed polygons, numbered layer and datatype pairs, and an exact integer unit. This converter re-models the drawing into that narrower form on the way through, which is precisely why the output is predictable for exposure and imprecise for drafting.
If your destination is a mask-layout flow rather than another CAD tool, DWG to GDSII skips the DXF hop entirely and is usually the better target. For the trade-offs between the drafting model and the mask model, see DXF vs GDSII.
Open it in the editor
Layer mapping, outline closure and a design-rule check are all worth doing before geometry reaches an exposure tool. Open in the free Glyph editor — nothing to install, and your files never leave your browser. See Layers and Design rule check.
Glyph is made by NANYTE. For where a finished layout goes next, read NANYTE's maskless lithography overview.