DXF viewer: see a CAD drawing, its layers and its size
Open a .dxf without installing a CAD program: a laser or CNC part, a floor plan from an architect, sign vinyl, a part from a supplier's website. You see the drawing, fit to the screen, every layer with its colour and how many entities it holds, the width and height in the file's own units, and which AutoCAD version wrote it.
The file is read on your device. It is not uploaded, and nothing in it is fetched or run.
What it shows
- The drawing. Fit to the screen on the page's light or dark background. Drag to move, pinch or scroll to zoom, double-click (or Fit) to see all of it again. Lines, polylines (their bulges drawn as true arcs), circles, arcs, ellipses, splines, points, TEXT and MTEXT, block inserts with their scale, rotation and arrays, blocks nested inside blocks up to 16 levels, SOLID and 3DFACE outlines, hatch boundaries and dimensions are drawn in the colour the file gives them.
- Layers. Every layer with its AutoCAD colour number (ACI) and swatch, how many entities sit on it, and a switch. Layers that are off or frozen in the file start switched off, as AutoCAD shows them.
- Size and units. The width and height of what is drawn, measured from the geometry itself (arcs and circles by their true outer edge), in the unit the file declares in
$INSUNITS: millimetres, inches, metres, feet and 20 others. - Which program version. The
$ACADVERcode turned into a name: AC1009 is R11/R12, AC1015 AutoCAD 2000, AC1018 2004, AC1021 2007, AC1024 2010, AC1027 2013, AC1032 2018 and later. - What is in it. Entity counts by type, the number of blocks, and a plain list of anything this page does not draw (for example “Not drawn: 3 × MESH, 1 × IMAGE”). Nothing is dropped without being counted.
- Export. The visible layers as an SVG with one group per layer, named after the layer. When the file is in millimetres, centimetres, metres, inches or feet, the SVG carries that real size, so it prints and imports into laser software at 1:1. The current view as a PNG.
The number that goes wrong most: units
A DXF stores bare numbers. A line from 0 to 100 is 100 “drawing units”, and only the header variable $INSUNITS says whether that means 100 mm or 100 inches. Many programs leave it at 0 (unitless), and then the laser software, the CNC post-processor or the print shop guesses. Guessing inches for a part drawn in millimetres makes it 25.4 times too big: a 100 mm bracket becomes 2,540 mm, and the job is refused or quoted for a sheet two metres wide. Guessing millimetres for an inch drawing makes a 4-inch part 4 mm long.
This page shows the unit the file declares, or says plainly that it declares none (and, if it is there, what $MEASUREMENT says: metric or imperial). If the width shown is 25.4 times what you expected, the drawing is in the other unit. Check this before you send a file to be cut.
How a polyline stores an arc: a worked example
A rounded corner in an LWPOLYLINE is not an arc entity. It is two vertices and a bulge on the first: the tangent of a quarter of the arc's included angle, positive when the arc turns counter-clockwise. A 90-degree fillet has a bulge of tan(22.5°) = 0.41421.
Take the corner of the sample drawing, from (114, 0) to (120, 6). The chord is √(6² + 6²) = 8.485 mm. The arc bulges out from the chord's midpoint (117, 3) by bulge × chord ÷ 2 = 0.41421 × 8.485 ÷ 2 = 1.757 mm, to (118.243, 1.757). The radius is chord × (1 + bulge²) ÷ (4 × bulge) = 8.485 × 1.17157 ÷ 1.65685 = 6.000 mm. A viewer that ignores bulges draws a straight chamfer there instead of a 6 mm radius; this page draws the arc, and its test checks the arc's midpoint against this hand calculation.
Files it opens
- ASCII DXF, any version
- From AutoCAD R12 (AC1009, still the version many laser and CNC programs write because everything reads it) to AutoCAD 2018 and later (AC1032). The reader was written for this page from Autodesk's DXF Reference, with no CAD library. Line ends can be CR LF or LF, and group codes may carry leading spaces.
- Binary DXF
- The rarer binary form, which starts with “AutoCAD Binary DXF”: both the R12 layout and the R13 and later one are read.
- Text in other languages
- DXFs from AutoCAD 2007 on are UTF-8. Older ones are in the Windows code page named in
$DWGCODEPAGE(ANSI_1252 for Western Europe, ANSI_1251 for Cyrillic, ANSI_932 for Japanese), and are read in that code page;\U+0416-style escapes are turned into their characters. - DWG files
- Recognised from their first bytes (
AC1015,AC1032and so on) and refused by name. DWG is AutoCAD's own closed format, and the free programs that read it (LibreDWG, and LibreCAD, which uses it) are GPL-licensed, so viewhack does not include them. The free ODA File Converter (Windows, macOS, Linux) or LibreCAD can save a DWG as DXF, and that DXF opens here.
What this cannot do
- Open DWG. See above: convert it to DXF first.
- Edit. It only reads, and saves an SVG or PNG copy; the DXF itself is never changed.
- Show 3D. Everything is seen from straight above: Z is flattened. 3D solids, surfaces and meshes made with ACIS or the MESH entity are counted as not drawn; a 3DFACE is drawn as its outline.
- Draw line weights or linetypes. Every line is drawn thin and solid; dashed and centre lines show as continuous lines.
- Render fonts exactly. Text is drawn in the page's own font at the height the file gives, so SHX and TrueType lettering looks different and its width is approximate. MTEXT keeps its line breaks but is not re-wrapped to its box, and its formatting (bold, colours, fonts, stacked fractions) is stripped to plain text.
- Fill hatches. Hatches and gradient fills are drawn as their boundary outlines only, without the pattern.
- Show paper space. Only model space is drawn. Title blocks and viewports on layout tabs are counted but not shown, and images, OLE objects and external references (Xrefs) are not loaded.