Slideshow: DXF vs DWG

Updated Apr 15, 2017
Slideshow DXF vs DWG

Here’s the ultimate showdown between the two most popular CAD file formats – DXF versus DWG. We’ve explained the differences between the two in an easy-to-digest slideshow format. It’s like a mini ebook that covers when and why both drawing files are used, the technical specification for each of them and the three key differences between both.

As you flip through the pages, you’ll learn that each file has a very dedicated purpose – the DXF is for data exchange while the DWG is mainly used in the AutoCAD environment. Never be confused between DXF and DWG again!


Table of Contents:

Overview: Graphic File Formats

Both DWG and DXF are vector graphic file formats. These are the types of files you use in CAD software CAD is used in a wide range of industries, including architecture, engineering, product design, manufacturing, project management and many others.

I’m new around here! What is CAD?
CAD stands for Computer Assisted Drawing. It is used to produce 2D and 3D drawings to visualize concepts and to simulate designs. Whatever was done with pencil, paper and a T-square in the past can now be done on the computer using CAD software.

DWG and DXF files can store all sorts of information. The majority of 2D CAD drawings will be formed of a combination of the following elements:

  • Text
  • Polygons (including poly- polygons)
  • Circles
  • Arcs
  • Bezier curves (including poly beziers)
  • Lines – including dotted lines, dash-dot lines, arrows and poly-lines.

The file formats differ by the type of information it can store and how it is encoded into the file. We’ll go into detail later.

8-2 Both DWG and DXF are vector files. This means that you can edit individual elements that make up an image, using a CAD program. Vector files allow you to scale certain shapes and change the colors and much more. You can’t edit raster files like JPEGs and PNGs in this same way.

The data in the DWG and DXF files are instructions to render drawings. The data mathematically describes the object being modelled. CAD programs then use this data to dynamically generate different views (images) of the model. Each data point is plotted using Cartesian coordinates, which are the X-Y coordinates on the grid. Every element of the drawing is made up of such points. A CAD package will connect the lines between these points to render the final graphic image. Sophisticated CAD programs can use this data to dynamically generate different views (images) of the model.

There are many other graphic file formats too:

Filename extension File format Description
.DWF Design Web Format This is a drawing file created for use on the Internet or for sharing (such as a .pdf file). This file can be viewed on the Internet browser, without having AutoCAD on their computer; making it a good file type for sharing.
.DXB Drawing Interchange Binary This is a simplified binary version of a DXF file. Some programs do not support as many functionalities as AutoCAD, and hence, do not require every single detail of a drawing file.
.PDF Portable Document Format PDF files are widely used for sharing drawings, especially for printing and reviewing. PDF files fit this purpose well, since they are difficult to edit and easy to annotate.

NOTE: DWG and DXF files are arguably the most popular file formats in the CAD world

What is DWG?

DWG is a proprietary file format used for storing 2D and 3D design data and metadata. It is the native file format for AutoCAD. The acronym DWG stands for DraWinG. Here are some samples of DWG files:

DWG was created at the same time as AutoCAD. In 1982, Autodesk created DWG with the launch of its first AutoCAD software. DWG went on to become the most widely used format for CAD drawings. In 1998, Autodesk estimates that there were 2 billion DWG files in existence. There’s easily more than 100 times that today.

Tip: Do not confuse the DWG file format with the DWG technology environment The DWG technology environment is the system that AutoCAD uses in its products, including Revit building design, AutoCAD and Inventor. The phrase refers to the capability to mold, render, draw, annotate and measure drawing elements.

What programs can I use to view and edit DWG files?
DWG File Editor:

  • AutoCAD
  • Scan2CAD
  • Some versions of Google Sketchup
  • DraftSight
  • IntelliCAD
  • CorelCAD

DWG File Viewer:

  • A360 Viewer (online viewer)
  • DWG TrueViewTM (online viewer)
  • AutoCAD 360 (mobile and web app)

What is DXF?

DXF is a vector graphic file format that stores 2D drawings, The acronym DXF stands for Drawing Exchange Format. DXF files are as widely used as DWG, especially since it is supported by almost all CAD programs in the world today. Here are some samples of DXF files:

CAD Drawing in DXF File - Engineering, Architecture and Fashion Design Examples

Here are few examples of drawings in DXF file format. It shows how all types of lines, polygons and text can be represented

Flashback into history… why was DXF developed? The DXF file format was created at the same time as DWG (1982) and by the same company – Autodesk. The DXF file format was developed to provide an exact representation of the data in the AutoCAD’s native file format, DWG. This enables other non-Autodesk applications to open drawings too. It was then adopted as the standard for data exchange between CAD programs. Back then, CAD software and drawings were saved onto floppy disks!

DXF file format enables data exchange between different CAD programs Different companies and industries often use different CAD systems. Each CAD software would have its own native file type and different ways of encoding information. However, in real life, most projects require design files to be shared between different colleagues. Here are few examples of CAD collaboration and data exchange.

E.g. 1: An artist sends his drawing to a cutting machine vendor. An artist designs signboards or sculptures using the software that he knows best, such as Adobe Illustrator or Photoshop. This design is then converted to a DXF file, using applications like Scan2CAD. Then, he’ll send it off to a cutting machine vendor, who will manufacture the actual product from his sketch. These types of machines are CNC machines, which work with vector drawing files like DXF. These machines use the vector files to generate automatic cutting instructions, bringing the artist’s design to life.

E.g. 2: An architect collaborates with a structural engineer. An architect may design his floorplan with AutoCAD, using various objects to represent windows, doors and so on. The architect then shares his drawing with an engineer, who uses another software to run finite-element structural analysis. He’d share this drawing as a DXF file to be processed. After the engineer computes the stresses and displacements, he can then send it back to the architect, who’d modify the deformed design.

E.g. 3: An interior designer takes a floorplan and visualizes the space in 3D using CAD software. Clients often share notebook sketches or photocopies of the original floor plan. The designer could save some time by simply scanning the sketch and converting it to DXF file format. He could then imports the DXF file into the CAD software, where he can set the correct scale and perfect his design.

What programs can I use to view and edit DXF files?
DWG File Editor:

  • AutoCAD
  • Scan2CAD
  • Adobe Illustrator
  • Open Office
  • TurboCAD
  • CorelCAD
  • SolidWorks
  • and many more…

DWG File Viewer:

  • eDrawings Viewer
  • Microsoft DWG Viewer
  • DataViz MacLink Plus

CAD programs that support DXF

How do you import/export drawings as DXF?
A designer creates a drawing in a CAD program that he’s familiar with. He saves the drawing as a DXF file He loads the DXF file into a different CAD program. It’s pretty much the same way you would open any file in any program.

Differences between DXF and DWG

The DWG file format encodes information in 1s and 0s – as opposed to another popular CAD format, DXF, which uses plain text

DWGs, which are binary files, are usually more compact than DXF. In DXF files, every element of the drawing is spelled out in numbers and letters. Each character takes up more bytes, e.g. character A in binary is 01000001. Therefore, DXFs file are usually larger in size. In DWG files, data is encoded with a series of 1s and 0s. Binary files are usually 25% smaller than plain text/ASCII files.

Complex DXF files can go up to hundreds of MB in size! Take a landscape drawing for example. With more than 100 layers, file transfer can get a little cumbersome. You’ll then have to split the drawing into few files or zip it when transferring. A good rule of thumb to go by: if it’s a regular drawing that’s not too complex, it should be about 10MB in size.

That’s because DXF files are written in ASCII. A DXF file is written in ASCII (plain text), which means that data is spelled out in letters and numbers. Every data point is: categorized into a section and each section is broken down into; and tagged with a group code, which is a value that identifies each value with the type of information. For e.g. group code 2 refers to the name of each section.

Sample of DXF File format in text form (Straight line shape)
Here’s an example of a straight line, stored in DXF format: If you open the file on a CAD program, you’ll see a simple straight line. If you open it on Notepad, you’ll see how the data is stored and structured. I used the DXF specification document to identify the DXF group codes:

  • Group code 0 marks the name of the drawing, which is a line
  • 10: X coordinate of start point, which is 15.64
  • 20: Y coordinate of start point, which is 38.24
  • 11: X coordinate of end point
  • 21: Y coordinate of end point This well-structured data serves as instructions for your CAD software package to reproduce the drawing.

DWG vs DXF - Open vs proprietary software
Open DXF files are more widely supported in the CAD environment. DXF can be used by almost all CAD software, as well as CNC and GIS software too. This is because it is an open-sourced file format that is free for anyone to use. DWG files can only be used with AutoCAD software or similar software license holders.

The full specification for the DXF file is published online, free of charge. Anyone who wants to write software that can read and write DXF files can do so, provided he/she has the necessary programming skills, of course! Remember, the DXF specification varies from release to release. There are minor changes such as new types of drawing elements supported. The rule of the thumb is: new programs can always read older files, but not the other way around.

Meanwhile, the DWG format is proprietary to AutoDesk The DWG format is the native format for AutoDesk’s CAD applications, including AutoCAD. As such, AutoDesk designs, defines and iterates the DWG specification. AutoDesk also sells a read/write library called RealDWG, for use in non-competitive applications. A group called Open Design Alliance have reverse-engineered the DWG file format – the OpenDWG specification is available online. In October 2006, Autodesk sued Open Design Alliance for infringing their trademark. Both parties have since come to an agreement.

DWG vs DXF - 3D vs 2D object types
DWG and DXF stores different types of drawing information. DWG handles 3D geometry DWG stores information about CAD models. It stores colours, line weights and x-references. vs DXF stores 2D vector images DXF files only retains information such as line work, dimensions and text. For example, DXF files manage “pen numbers” instead of colours and line styles.

DXF files do not support application-specific information For example, it does not support AutoCAD’s dynamic blocks. This is a feature specific to AutoCAD, which changes the shape and size of the block depending on a set of rules. Be careful that you don’t lose some data when importing and exporting drawings as DXF files. This is a drawing of a door, created using the AutoCAD program. Instead of inserting multiple blocks with different angles, you can define a set of rules to change the drawing. You cannot encode the same rules in a DXF file.

Summary of the differences

  1. Compatibility with different CAD programs: The DXF format is open-sourced and almost every CAD software supports it. The DWG format is proprietary to Autodesk and is supported only by AutoCAD and other licensed software
  2. File size: DXF is a plain-text format and complicated drawings are usually slightly larger than DWG. DWG is a binary file, so information is stored a little more efficiently
  3. Objects supported by file format: DXF only supports lines, text, polygons and circles. DWG stores all types of information that a user can enter, including 3D elements and photos

Should you use DWG or DXF?

Well, it depends on what you’re trying to achieve! Few questions to consider:

  • What CAD programs are you using to view/edit your drawing file?
  • What file formats do these programs support?
  • Are you sharing the drawing file with any other collaborators? Do they have any requirements regarding the file type?

When should .DWG be used?

If your drawing will only be accessed via AutoCAD, or a program that is capable of handling DWG files… Then it is convenient to use the default file format – DWG. You might lose some data when exporting it to DXF, especially those linked to specialized features. This screenshot shows how the fancy Plex.Earth tools in AutoCAD Civil work.

Case study: When a contractor uses DWG files Construction:
After plotting the building in Autodesk’s Building Design Suite (a CAD package that uses DWG), the contractor can coordinate site and workflow planning, as well as calculate cost of labor and materials for different design alternatives The drawing was used to simulate the construction of the building. Watch the entire case study here

When should .DXF be used?

If you’re sharing drawings between different CAD programs… DXF is always the way to go. This is especially so if DWG import and export is not supported. Most CAD applications can open DXF files and reference the included information, but do not have the capability to open a DWG file.

Case study: When an archaeologist uses DXF files Landscape Archtecture:
Natural Trust volunteer, Michael Bennison used an MS Access database of X-Y coordinates of plants in the park. He exports this data as a DXF file. Now, he can load it into a CAD application and overlay the data points onto a map. Here’s a map of a Sheffield park, with different plantings plotted in different colors. Click to read more about this fascinating project on our blog

This guide is brought to you by Scan2CAD, the market leading file conversion and editing software. Get more guides and articles regarding DXF files and conversion tips on our blog:

Scan2CAD is the market leading file conversion and editing software. Download your free trial Scan2CAD includes conversion tools, image editing and cleaning tools, smart OCR, full PDF support, as well as vector recognition and editing.

scan2cad advert for free trial