This document compares the DWG and DXF file formats. DWG is the native format for AutoCAD, while DXF was developed to enable data exchange between CAD programs. DXF files are ASCII text files that are widely supported, but can be large in size. DWG files are more compact binary files, but are proprietary to AutoCAD. The document provides details on when each file type should be used, such as using DWG for AutoCAD files and DXF for sharing between programs.
DXF versus DWG: A Comparison of Vector Graphic File Formats
1. This guide is brought to you by Scan2CAD,
the market leading file conversion and editing
software
DXF vs.
DWG
A comparison between the two
most popular graphic file formats
2. Table of Contents
▪ Overview: Graphic file formats
▪ What is DWG?
▪ What is DXF?
▪ Differences between DXF and DWG
▪ Should you use DWG or DXF?
3. 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.
I’m new around here! What is
CAD?
4. 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
5. 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.
6. 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.
7. Filename extension
.DWF
.DXB
.PDF
File format
Design Web Format
Drawing Interchange
Binary
Portable Document
Format
Description
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; making it a good file type for sharing.
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 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.
There are many other graphic file formats too
NOTE: DWG and DXF files are arguably the most popular file formats in the CAD world
8. Table of Contents
▪ Overview: Graphic file formats
▪ What is DWG?
▪ What is DXF?
▪ Differences between DXF and DWG
▪ Should you use DWG or DXF?
9. 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:
10. 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.
Fun fact: the above logo is the very first
AutoCAD logo. We found it printed on the
first software manuals!
Remember that clunky computer?
Buildings and cars were designed on
these machines!
11. 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.
12. What programs can I use to view and edit DWG files?
▪ AutoCAD
▪ Scan2CAD
▪ Some versions of Google Sketchup
▪ DraftSight
▪ IntelliCAD
▪ CorelCAD
DWG File Editor DWG File Viewer
▪ A360 Viewer (online viewer)
▪ DWG TrueViewTM (online
viewer)
▪ AutoCAD 360 (mobile and
web app)
13. Table of Contents
▪ Overview: Graphic file formats
▪ What is DWG?
▪ What is DXF?
▪ Differences between DXF and DWG
▪ Should you use DWG or DXF?
14. 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
15. 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!
16. DXF file format enables data exchange between
different CAD programs
Image source: www.grabcad.com
Why do we need data
exchange?
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
You’d share your drawing to clients for
feedback and to 3D printers and CNC
machines
17. 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.
18. 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.
19. 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.
20. What programs can I use to view and edit DXF files?
▪ AutoCAD
▪ Adobe Illustrator
▪ CorelCAD
▪ Open Office
▪ TurboCAD
DXF File Editor
▪ SolidWorks
▪ Scan2CAD
And many more…
DXF File Viewer
▪ eDrawings Viewer
▪ Microsoft DWG Viewer
▪ DataViz MacLink Plus
21. 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.
22. Table of Contents
▪ Overview: Graphic file formats
▪ What is DWG?
▪ What is DXF?
▪ Differences between DXF and DWG
▪ Should you use DWG or DXF?
23. DWG, which are binary files
DWG 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.
1
DXF, which are ASCII/ Plain-text files
vs
24. Complex DXF files can go up to hundreds of MB in size!
Take this 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.
25. 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;
▪ Tagged with a group code, which is a value that identifies each value with the type
of information, e.g. group code 2 refers to the name of each section.
26. 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.
27. Open
DXF files are more widely supported in the CAD
environment
Image source: BBC Bite Size – Software Concepts (link)
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.
vs
2
Proprietary
DWG files can only be used with
AutoCAD software or similar software
license holders.
28. 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.
29. 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.
30. DWG and DXF stores different types of drawing
information
3
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.
31. 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.
32. Summary of the differences
Title
Compatibility
with different
CAD programs
File size
Objects
supported
by file format
DXF File Format
▪ The DXF format
is open-sourced
and almost every
CAD software
supports it
▪ DXF is a plain-text format
and complicated drawings
are usually slightly larger
than DWG
▪ DXF only supports lines,
text, polygons and circles
DWG File Format
▪ The DWG format is
proprietary to Autodesk
and is only supported by
AutoCAD
▪ DWG is a binary file, so
information is stored a
little more efficiently
▪ DWG stores all types of
information that a user
can enter, including
3D elements
and photos
33. Table of Contents
▪ Overview: Graphic file formats
▪ What is DWG?
▪ What is DXF?
▪ Differences between DXF and DWG
▪ Should you use DWG or DXF?
34. Should you use DXF or DWG?
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?
35. 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.
36. 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
37. 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.
38. 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
39. Text
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:
www.scan2cad.com/dxf
40. 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. Click on the blue button to learn
more about Scan2CAD.