DWG vs DXF vs PDF: what's the difference?

DWG is AutoCAD's own drawing format, DXF is the open exchange version of the same drawing, and PDF is a picture of the sheet. Here is what each keeps, what each loses, and how to convert between them.

Updated

Short answer: DWG is AutoCAD's native drawing file. DXF is the same kind of drawing written in Autodesk's open exchange format, so almost every CAD program can read it. PDF is a page for viewing and printing: it may contain sharp vector lines, but it is not a CAD drawing, and a scanned PDF is just a picture.

The three formats at a glance

DWGDXFPDF
What it isAutoCAD's native drawing fileDrawing Exchange Format, Autodesk's documented exchange filePortable Document Format, a fixed page for viewing and printing
Owner and specAutodesk; the format is not officially publishedAutodesk; the reference is publishedAdobe originally, now the open standard ISO 32000
How it is storedCompact binaryUsually plain text (a binary variant exists); larger filesBinary page description
Editable in CADYesYesOnly after import (vector PDFs) or tracing (scanned PDFs)
LayersYesYesOptional, if the exporter wrote them; they become plain layer names on import
Real units and scaleYes, drawing unitsYes, drawing unitsOnly a print scale on the page
Typical useWorking files between AutoCAD usersMoving drawings between programs, CNC, laser cuttingSharing, printing, review and markup

DWG: AutoCAD's working file

DWG is what AutoCAD saves by default. It stores every object in the drawing (lines, polylines, arcs, hatches, text, dimensions, blocks, layers, layouts) in a compact binary form. Autodesk does not publish the format; other CAD programs such as BricsCAD and DraftSight read and write it through libraries from the Open Design Alliance, which has worked out the format over many years.

DWG also has versions. AutoCAD changes the file format every few releases (the 2004, 2007, 2010, 2013 and 2018 formats are the ones you will meet), and an older AutoCAD cannot open a newer DWG. When someone says "save it down to 2013", that is what they mean.

DXF: the same drawing, in the open

Autodesk introduced DXF in 1982, with the first version of AutoCAD, so that other programs could exchange drawings with it. The format is documented, usually stored as readable text, and supported by practically every 2D CAD, CAM and vector program. The trade-off is size: a DXF is several times larger than the same drawing saved as DWG.

For a floor plan, DXF keeps everything that matters: wall polylines, arcs, text, layers, colours and units. Open it in AutoCAD and use Save As to make it a DWG. To convert many files at once, the free ODA File Converter from the Open Design Alliance converts between DXF and DWG versions in batches.

PDF: a picture of the sheet

A PDF describes a printed page. When you plot a drawing to PDF from CAD, the lines are usually saved as sharp vectors, sometimes with layers, but the CAD meaning is gone: a wall polyline becomes a set of strokes, a block becomes loose lines, text drawn with SHX fonts can turn into tiny line segments, and the only scale is the print scale on the page.

A scanned PDF is different again. It holds a photo of the paper and no lines at all.

How to tell which PDF you have

Zoom in far, to 1,000 % or more. If the lines stay crisp, the PDF contains vectors. If they become blurry or blocky, it is a raster scan. You can also try to select a line or a word: vector content can be selected, a scan cannot.

Converting between them

From → ToHowWhat you lose
DWG → DXFSave As DXF in AutoCAD, or ODA File ConverterNothing that matters for a plan
DXF → DWGOpen in AutoCAD and Save As DWG, or ODA File ConverterNothing that matters for a plan
DWG or DXF → PDFPlot or export to PDFEditable objects; you get a page
Vector PDF → DWGAutoCAD's PDFIMPORT command (AutoCAD 2017 and later)Blocks, dimensions and polylines come in as simpler lines; you clean up
Scanned PDF or image → DWGTrace it: by hand over an attached image, with AutoCAD's Raster Design toolset, with Scan2CAD, or with an online tracer such as ImageToDWGWhatever the tracer misreads; check walls, doors and text

Two points trip people up. First, PDFIMPORT on a scanned PDF only brings the scan in as an image; Autodesk's own support notes say the raster is not turned into geometry. Second, some generic file converters "convert" a JPG or PNG to DWG by embedding the picture in the drawing, which looks like a drawing but has no lines you can edit.

Which one should you use?

  • Working with AutoCAD users: DWG, in a version they can open.
  • Sending to another CAD program, a CNC machine or a laser cutter, or you are not sure: DXF.
  • Someone only needs to look, print or comment: PDF.
  • You only have a picture or a scan: none of the above yet. Trace it into DXF first, then save it as DWG.

Where ImageToDWG fits

ImageToDWG is a tracer for the last case. Upload a JPG, PNG or WebP of a floor plan and it returns a DXF with walls as closed polylines on a WALLS layer, door swings on DOORS, centre lines on WALL_AXIS, text read from the image on TEXT and everything else on OTHER. It does not read PDFs yet; for a PDF, export the page as a PNG first, as described on the PDF to DWG page. We make this tool, so weigh our view accordingly, and read the quick facts on the converter page for its limits before you rely on it.

Have a floor plan image to convert?

Upload a JPG, PNG or WebP and check the traced walls for free before you download anything.

Try the converter

Frequently asked questions

Is DXF the same as DWG?

They hold the same kind of drawing: lines, polylines, arcs, text, blocks and layers. DWG is AutoCAD's compact native file; DXF is Autodesk's published exchange format, usually plain text. AutoCAD opens a DXF and saves it as DWG with Save As, and in practice nothing a floor plan needs is lost in that step.

Can AutoCAD open a DXF file?

Yes. Every version of AutoCAD and AutoCAD LT opens DXF directly from File > Open; choose DXF as the file type if it is not listed.

Can I convert a PDF to DWG?

It depends on the PDF. A PDF exported from a CAD program contains vector lines, and AutoCAD's PDFIMPORT command turns them into editable objects. A scanned PDF is only an image, so its lines have to be traced, by hand or with a raster-to-vector tool.

Which format should I send to someone?

Send DWG to AutoCAD users, DXF when you do not know which CAD program they use or the file goes to a laser cutter or CNC machine, and PDF when they only need to look at, print or mark up the drawing.

Why do online converters give DXF instead of DWG?

DXF is publicly documented and open-source libraries can write it reliably. DWG is a closed format whose official writer belongs to Autodesk, so most web tools produce DXF and leave the one-click Save As DWG to your CAD program.