Open DWG file
Home › Comparisons › DXF vs DWG: what is the difference?

DXF vs DWG: what is the difference?

DXF vs DWG comes down to one trade-off: DWG is AutoCAD's compact, closed binary format for working on a drawing, while DXF is the open, text-based version of the same data made for exchanging it with other programs. Both hold identical geometry, layers and blocks. Which one you use depends on who or what has to read the file next.

DWG vs DXF at a glance

DWGDXF
Full nameDrawingDrawing Exchange Format
EncodingBinary, compressed since 2004ASCII text (binary variant exists)
SpecificationClosed, owned by Autodesk; read via ODA and LibreDWGPublished by Autodesk, free to implement
Typical sizeSmallestRoughly 3 to 10 times larger (ASCII)
EditableYes, native in AutoCAD, BricsCAD and othersYes, in any CAD program that imports it
Data keptEverything, including custom objectsStandard entities; custom objects become proxies
Readable in a text editorNoYes
Main useWorking and archive file for CAD usersInterchange: other CAD, CNC and laser cutters, GIS, Inkscape
Opens in this viewerR14 to 2018+Any version, ASCII or binary
Check the file in the viewerDrop a DWG or DXF here to open it. Nothing is uploaded.DWG R14–2018+, DXF ASCII or binary, up to 60 MB. Private: the file stays in this browser tab.

Why DWG is smaller and DXF is bigger

A DWG stores each entity as packed binary fields with handles and, since AutoCAD 2004, compresses whole sections. A DXF writes every value as a line of text with a group code in front of it, so a single line segment that takes a few dozen bytes in DWG takes a couple of hundred bytes in DXF. The DWG vs DXF file size ratio therefore depends on the content, but 3 to 10 times is normal for drawings full of small entities such as polylines and hatches, and the gap grows with precision, because DXF writes coordinates as decimal text. Binary DXF closes most of the gap but is read by few programs, so in practice "DXF" means the text version.

The text structure is also the advantage. You can open a DXF, read the $ACADVER line to see its version, search for a layer name, or write one from a script in a few lines of code. None of that is possible with a DWG without a library that understands the reverse-engineered format.

What changes when you convert DWG to DXF

For ordinary 2D drawings, nothing visible. Lines, polylines, arcs, circles, splines, text, MTEXT, dimensions, hatches, blocks, layers, linetypes and layouts all have DXF equivalents. What does change: custom objects from vertical products (Civil 3D alignments, AutoCAD Architecture walls, Plant 3D pipes) have no DXF definition and are written as proxy graphics, meaning they still display but lose their intelligence. Thumbnails, some sheet-set data and digital signatures are dropped. Going the other way, DXF to DWG is lossless.

Version matters as much as format. An R12 DXF, the one most cutters ask for, has no lightweight polylines, MTEXT or true splines, so AutoCAD explodes or approximates them on export. If a receiving program chokes on your DXF, a lower version (2000 or R12) is the usual fix; see DXF versions.

DWG or DXF: which should you use?

  • Sending to an AutoCAD, BricsCAD or Revit user: DWG. Smaller, keeps everything, and it is what they expect.
  • Sending to a laser, plasma, CNC or vinyl cutter: DXF, usually R12 or 2000, 2D only, with the shapes as closed polylines on one layer.
  • Importing into Inkscape, Illustrator, GIS, Blender or a web app: DXF, because those tools read the published format directly.
  • Archiving: keep the DWG as the master and add a PDF for people without CAD; DXF is a fine second copy because it will stay readable in any text editor.
  • Just viewing on macOS, Linux or a tablet: either. The viewer on this page opens both in the browser without uploading them, and the sister site dxfviewer.app does the same for DXF with a Chrome extension for .dxf links.

Converting is straightforward in either direction with AutoCAD, DWG TrueView or the free ODA File Converter; this viewer converts DWG to DXF on the device to render it, but a DXF download is not available yet. See DWG to DXF.

Verdict

DWG is the better working format: smaller, complete, and native to the programs most drawings are made in. DXF is the better exchange format: open, readable, and accepted by everything from CAD to cutting machines. Keep your masters in DWG, export DXF when a non-Autodesk tool needs the geometry, and export PDF when a person needs a picture. Neither is "more compatible" in general; it depends entirely on the reader at the other end.

Frequently asked questions

What is the difference between DWG and DXF files?

DWG is AutoCAD's compressed binary format with a closed specification; DXF is the same drawing written as open text pairs of group codes and values. DWG is smaller and keeps more; DXF is readable by more programs.

What is the DWG vs DXF file size ratio?

An ASCII DXF is usually 3 to 10 times larger than the equivalent DWG, depending on entity count and precision. Binary DXF is about a quarter of the ASCII size.

Which is better, DWG or DXF?

Neither in general. Use DWG for working files and CAD users, DXF for cutters, GIS, Inkscape and any non-Autodesk program.

Does DXF keep layers?

Yes. DXF stores the full layer table, plus linetypes, blocks, text styles and dimension styles. Only proprietary custom objects lose their intelligence.

Can I convert DXF to DWG for free?

Yes, with Autodesk DWG TrueView (Windows) or the ODA File Converter (Windows, macOS, Linux). This browser viewer does not write DWG files.

How do I view DXF or DWG files on macOS?

Open either file in the viewer on this page in Safari, Chrome or Firefox; nothing is installed or uploaded. See open DWG on a Mac.