@if (measurement; as m) {
Distance {{ m.d }} · ΔX {{ m.dx }} · ΔY {{ m.dy }} · angle {{ m.angle }}
} @else if (measure) {
Now click the second point.
} @else {
Click two points to measure between them. Clicks snap to the nearest corner or end within a few pixels.
}
}
Scroll or pinch to zoom, drag to pan.@if (skippedLabel) { Not drawn: {{ skippedLabel }}. }
}
About this DWG and DXF viewer
DWG is AutoCAD’s own format and DXF the one CAD programs use to swap drawings: floor plans from an architect, parts for a laser cutter or CNC router, site plans, exports from AutoCAD, LibreCAD, SolidWorks and Fusion. This opens either and draws it - lines, arcs, circles, polylines, splines, text, dimensions, leaders, hatches and blocks, in the drawing’s own colours and linetypes - with pan and zoom, a list of layers to switch on and off, and a measuring tool that snaps to corners and ends.
A DWG is first converted to DXF in the page by LibreDWG, the GNU project’s DWG reader, compiled to WebAssembly; the converter (about 3 MB) downloads the first time, and the converted DXF can be saved. Hatch patterns are shown as a light tint of their colour rather than line by line, tables are not drawn, and only model space is shown - not the paper-space sheet layouts.
What you can do
Open a DWG file without AutoCAD, from AutoCAD R14 through 2018 and later
Open an ASCII DXF file from R12 onwards (not the rare binary DXF, and not 3D solid models)
Lines, arcs, circles, polylines, splines, text, dimensions, leaders, hatches and blocks, in the drawing’s own colours and linetypes
Pan and zoom with the mouse, scroll wheel or a pinch, and Fit to see the whole drawing
Switch layers on and off, with a filter for drawings with many layers
Measure the distance and angle between two points, snapping to corners and ends
Convert DWG to DXF, with layers left on, off or frozen as they were
Save the view as a PNG or the whole drawing as an SVG
Dark or light background
How to open a DWG or DXF file without AutoCAD
Drop the .dwg or .dxf onto the page, or click to choose it. A DWG takes a second or two longer while it is converted.
Scroll or pinch to zoom, and drag to move around; Fit brings the whole drawing back.
Untick layers in the list to hide them - a plan with its furniture or dimensions switched off is often easier to read.
Choose Measure and click two points for the distance between them, or save the drawing as a PNG of the view, an SVG of the whole thing, or - for a DWG - a DXF.
Questions
Can it convert a DWG to DXF?
Yes. Open the DWG and a .dxf button appears next to PNG and SVG; it saves the converted drawing, with its layers in the same on, off and frozen states as the original, ready for LibreCAD, a laser cutter’s software or any other program that reads DXF.
How accurate is the measuring tool?
As accurate as the drawing: when a click lands within a few pixels of a corner or an end it snaps to that exact point, and the distance is worked out from the coordinates in the file. The units come from the drawing’s own setting, so a file saved without one shows plain numbers.
Why does the drawing look different from AutoCAD?
Mainly fonts and hatching. Text is drawn in a standard sans-serif rather than the drawing’s SHX fonts, so lettering can be slightly wider or narrower, and hatch patterns show as a tint. Leaders are drawn without their arrowheads, and tables are left out. Geometry, layers, colours and linetypes follow the file.
Is the drawing sent to a server?
No. The file is read, converted and drawn by the page itself - the DWG converter is downloaded to your browser, not your drawing to a server - which matters for drawings of someone’s house, or a part that is not public yet.
Why is the source code of this viewer published?
The DWG converter, LibreDWG, is licensed under the GNU GPL, which asks that software built with it shares its own source on the same terms. So the viewer’s code is published under GPL-3.0 at /source/dxf-viewer/ on this site, and anyone may read, change or reuse it.