|Introduction | Sustainability Factors | Content Categories | Format Descriptions | Contact|
|Full name||AutoCAD Drawing file (DWG) Family|
DWG is the proprietary native file format for AutoCAD, one of the most popular computer-assisted design (CAD) packages. The format is maintained by AutoDesk. DWG is a compact binary format that stores and describes the content of 2D and 3D design data and metadata. AutoCAD 1.0 was released in 1982, but the origins of the DWG format are from the late 1970s, when it was the native format for a CAD package called Interact. The format has been updated frequently as the AutoCAD product has been enhanced.
As of November 2016, PRONOM has identified 19 chronological versions, none of which is publicly documented by AutoDesk. See File type signifiers below. The compilers of this resource have chosen to describe the DWG family of formats in a single document. See Notes below, for information about the chronological versions of the AutoCAD application and associated versions of the DWG format.
The syntactic structure of a DWG drawing file includes sections and section substructures. The primary substance of a drawing is in a section with name AcDb:AcDbObjects. This contains component graphical elements (known as entities) and other objects that support the editing and rendering of drawings. Internal connections in the drawing file use identifiers for objects (including the graphical entities) known as "handles." Objects declare their own handles and may refer to other objects via handle references. Handle references may indicate ownership or simply be pointers to other structures. See Notes below for more on handles in DWG files. Cyclic redundancy checksums (CRC) are used extensively for error detection.
A typical DWG file will include at least the following sections:
See Notes below for more sections and object types that might occur in DWG files.
|Production phase||Used primarily for creation of design drawings and models and as master format for deriving renderings in two or three dimensions. In the domain of architecture, used for collaboration among architects and engineers designing, constructing, and maintaining buildings.|
|Relationship to other formats|
|Other||DXF_ASCII_Family, DXF (AutoCAD Drawing Exchange Format) Family, ASCII variant. Originally designed to be an ASCII equivalent to DWG. For many situations, the DXF format can still contain all the information in a source DWG file. See Notes below on relationship between DWG and DXF_ASCII.|
|Other||DWF (Design Web Format) and DWFX, proprietary formats from AutoDesk for publishing designs for review, not described separately on this website. See Notes below on related publishing formats from AutoDesk.|
|LC experience or existing holdings|
|LC preference||Among vector graphics formats, the Library of Congress has expressed a preference for the AutoCAD Drawing Interchange Format (DXF). Widely used proprietary formats are acceptable if needed to be a faithful representation of a work. See Recommended Formats Statement: Still Image Works.|
The DWG format is a proprietary format developed and maintained by AutoDesk. No specification has been published by AutoDesk.
The conceptual and semantic aspects of the DWG drawing format are covered best in the documentation AutoDesk supplies for the DXF Drawing Interchange Format in its help system [About the DXF Format | AutoCAD 2017].
The closest thing to a specification for the syntax of DWG files is the Open Design Specification for .dwg files, derived by the Open Design Alliance (ODA) by reverse engineering. As of November 2016, this document covers the DWG format from AutoCAD Release 13 through AutoCAD 2013 (AC1027). The AC1027 version of DWG has been used from AutoCAD 2013 through AutoCAD 2017. The ODA is an organization of over 1,000 firms that support the development of the Teigha toolkit to allow members to read and write files in DWG and other formats.
The DWG format is very widely used. It is the native format for AutoCAD and other AutoDesk products. According to a blog post at In The Fold, AutoCAD scored top marks in a Winter 2015 rating for General-Purpose CAD. Is BricsCAD A Real Alternative to AutoCAD?, a blog post from April 28, 2015, indicates, "Products competitive to AutoCAD have come and gone over the years. None appear to have the critical functionality and the supporting infrastructure to cause established AutoCAD users to risk the switch." The post goes on to suggest that 100% DWG compatibility is the most important factor in considering alternative products. CAD applications that use DWG as the native format include: products based on the IntelliCAD Technology Consortium platform, such as CMS Intellicad; products based on the Open Design Alliance platform Teigha, such as Caddie, BricsCAD, DraftSight, and NanoCAD; and CADKON+. See Wikipedia's Comparison of Computer-aided Design Editors for information about support for DWG in many other CAD applications.
RealDWG is a software development kit (SDK) supported and used by AutoDesk and available for license from Tech Soft 3D. Source code for the Open Design Alliance's Teigha Kernel, Drawings, and other modules are available to ODA's founding and corporate subscribers. ODA's Teigha Drawings code is based on software libraries previously known as OpenDWG and DWGdirect. Source code for the core IntelliCAD software is available to commercial members of the IntelliCAD Technology Consortium (ITC). However, the code used to read and write DWG files is the same for both consortia. ITC is a member of ODA (see The ITC and the ODA: Complete opensource CAD solution). According to ITC President, David Lorenzo, "The ITC has based IntelliCAD development on the ODA libraries since its inception, and we know they will deliver the core technology required for our open source CAD engine to support any new .dwg or .dgn file formats in the future." The description of the Teigha or ITC code-bases as "open source" has been questioned, for example in the Talk page on Wikipedia entry for IntelliCAD.
Open-source projects that aim to read and write DWG files include: LibreDWG (a C library to handle DWG files) and LibreCAD (an open-source 2D CAD application based on Qt, previously known as QCad then CADuntu). However, it appears that developing and supporting CAD applications may demand more effort and expertise than free open-source projects can maintain over the long term. In February 2016, a message in a discussion thread in the libredwg mail list with subject "Looking for new maintainers" includes the paragraph from one of the project leaders, "Maybe it is a good time to discuss the future of this project. LibreCAD have implemented libdxfrw with DXF-rw (obviously) and DWG-r, apparently at a better stage than LibreDWG. Licenses were incompatible so they just hacked it themselves." And, in May 2016, the LibreCAD blog announced the departure from the team of "a very valuable asset."
There are a number of free or inexpensive applications that can be used to view DWG drawing files, including: the Teigha Viewer; DraftSight a free CAD application; the eDrawings app for iOS and Android; and several viewers from AutoDesk, including the online A360 viewer, DWG TrueView, and the AutoCAD 360 app for mobile devices.
Several archival organizations have listed DWG as preferred or acceptable for depositing or storing CAD drawings: Harvard Digital Repository Service, Library and Archives Canada, the UK Data Archive, UK Archaeology Data Service, and National Archives of Australia.
|Licensing and patents||
AutoDesk and partner Tech Soft 3D make available, via license, RealDWG, a Software Development Kit (SDK) for reading and writing DWG files.
As detailed in the section on AutoDesk Trademark in the Wikipedia entry for .dwg, AutoDesk has attempted to use trademark law to retain control of the format. In 2006, AutoDesk sued the Open Design Alliance, "alleging that its DWGdirect libraries infringed Autodesk's trademark for the word 'Autodesk', by writing the TrustedDWG watermark (including the word 'AutoCAD') into DWG files it created." The issue was settled in 2007.
This proprietary binary format is not transparent. ODA's attempt at reverse-engineering, Open Design Specification for .dwg files, demonstrates the degree to which developing code to interpret DWG files would be difficult. The need to conserve space in the early days led to techniques to save bits that would obscure the structure. Structure and semantics are conveyed through numeric "group codes," not by human-readable tags. New group codes can be introduced without documentation.
Metadata may be embedded in a DWG file. Sections in the DWG file that maybe used include Summary Info, Revision History, and AppInfo (information about the creating information). The compilers of this resource have not ascertained how widely these capabilities are used. Comments welcome.
None beyond software that can interpret DWG files in general, and more specifically, the types of objects and entities included, some of which may be specific to the applications used in the creation of the file.
|Technical protection considerations||
The DWG format supports encryption of much of the file's content. Some DWG files may have been saved with a password using an internal mechanism, but this capability has been eliminated starting with AutoCAD 2016. AutoDesk now recommends the use of any encryption product that meets current industry standards and is updated as needed.
|Normal rendering||Good support.|
|Clarity (high image resolution)||Scalable.|
|Color maintenance||Color specification in DWG is by indexed palettes or True Color (RGB color space, 24-bit depth). See About Setting the Color of Objects from AutoCAD Help.|
|Support for vector graphics, including graphic effects and typography||Excellent support for vector graphics. More than 60 types of geometric objects are defined, as well as grouping of objects as Blocks or in Layers.|
|Support for multispectral bands||Not applicable.|
|Functionality beyond normal rendering||
Support for 3D models as well as 2D drawings. Support for multiple viewports and geospatial positioning.
|Support for CAD/CAM/CAE||
Excellent support for 2D drawings. Support for some 3D model types. AutoCAD's native method for 3D modeling is based on a polymesh construct that uses 3D FACEs. ACIS solids can also be embedded in a DWG file. See Notes below on 3D Objects in DWG files.
According to Wikipedia's Comparison of Computer-aided Design Editors, AutoCAD supports BIM (Building Information Modelling) and IFC (Industry Foundation Classes) for some "verticals." However, it is unclear to the compilers of this resource whether BIM data would ever be stored in a DWG file. Comments welcome.
||Closely related files use the same format structure: .bak (for drawing backup), .dws (for drawing standards), .dwt (for drawing templates) and .sv$ (temporary automatic save) files are also DWG files.|
|Internet Media Type||image/vnd.dwg
||See registration correspondence at IANA.|
|Magic numbers||Hex: 41 43 31 30
|These four bytes act as magic numbers for DWG files created by AutoCAD versions since 2.5 (released June 1986). Versions 1.2-2.22 (AutoCAD releases April 1983-early 1986) have ASCII "AC" as the first two bytes. AutoCAD 1.0 used "MC0.0" as the first five bytes of DWG files. See History notes.|
|Indicator for profile, level, version, etc.||See note.||The first six bytes of a DWG file indicate the version of the format. See signifier row for magic numbers above, and History notes.|
|Pronom PUID||See note.||As of November 2016, PRONOM had assigned 19 PUIDs to different chronological versions of the DWG format, the most recent being fmt/531 for the version of the format used for AutoCAD 2013 through AutoCAD 2017 (the current version as of November 2016).|
|Wikidata Title ID||Q1053358
Additional sections and object types: Additional features that may be present in DWG files include:
Error detection and correction: The DWG format makes extensive use of Cyclic Redundancy Checks (CRC) to support error detection. The version with code AC1021 (introduced in AutoCAD 2007) also uses Reed-Solomon encoding to support error correction. However, this mechanism was dropped in subsequent versions (AC1024, AC1027).
Handles in DWG files: Objects in DWG files are referred to by object "handles." The syntax for these handle references comprises: a 4-bit code for handle type; a 4-bit counter for the length in bytes of the handle; followed by the handle itself. The type codes distinguish between references that indicate an object directly and those that are expressed as an offset to another handle. The type codes for direct references divide handles into four categories:
Note: This use of the term "handle" is not related to the Handle System, introduced in 1995 to manage persistent identifiers for digital objects.
3D objects in DWG files: AutoCAD was originally focused on a digital equivalent of drawings on paper but has steadily added 3D modeling features. For example, a blog post from AutoDesk on AutoCAD 2010 and 3D highlights new features. The post discusses AutoCAD 2010 features that support two technical forms of 3D representation: meshes and solids. Both types of 3D model can be stored in a DWG file (starting at least from AC1024): Polymesh objects (also referred to as polyface meshes) are constructed from POLYLINE objects, which connect vertices; 3DSOLID and BODY objects hold 3D content in a form that allows solids to be hollowed out or surfaces to have thickness. The documentation for dxfgrabber indicates that the content of 3DSOLID and BODY have typically been ACIS solid models in SAT (Standard ACIS Text) form, but that since AutoCAD 2013 (AC1027), AutoCAD has stored ACIS data as SAB (Standard ACIS binary). The AutoDesk documentation does not mention ACIS by name, but indicates that the content of 3DSOLID is of type "AcDbModelerGeometry" with modeler format version (currently 1) and a number of lines of proprietary data. Judging from the DXF documentation available online, the 3DSOLID object was introduced with Release 13 of AutoCAD around 1995. The reverse-engineered Open Design Specification for DWG describes these ACIS 3D objects in clause 19.4.39 and chapter 23, indicating that embedded SAB data is preceded by "ACIS BinaryFile" in ASCII and followed by "End\x0E\x02of\x0E\x04ACIS\x0D\x04data".
Relationship of DXF and DWG: AutoCAD's Save Drawing As command offers the option of DWG and DXF formats. The usual DXF file is a transparent ASCII text file, often recommended for interchange and preservation for this reason. See DXF_ASCII. An equivalent binary DXF format is also defined; it is almost always described as "DXF Binary" or "Binary DXF". DXF_Binary is not described separately on this website.
According to a slideshow comparison of DWG and DXF from Scan2CAD, "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." However, AutoCAD has added and enhanced many features, some of which include embedding data not easily incorporated into a text file. For example, the current DWG format includes the ability to embed Standard ACIS Binary (SAB) data and arbitrary blobs in the AcDsPrototype_1b section. The compilers of this resource have not been able to determine the degree to which the full semantic and functional content of all DWG files can be represented in DXF_ASCII files saved as DXF within AutoCAD. Comments welcome, particularly to identify content that may be held in a DWG file but would be either omitted or significantly changed when a DXF_ASCII file is written out.
Statements about potential differences between the content of a DWG drawing and a corresponding DXF representation include:
A separate issue is numerical precision. Conversion of numeric values represented in floating-point binary to ASCII characters always has the potential for loss of accuracy. This is mentioned in the DXF documentation from AutoDesk by the statement, "Unlike ASCII DXF files, which entail a trade-off between size and floating-point accuracy, binary DXF files preserve the accuracy in the drawing database." However, in many circumstances the difference will not be significant, as indicated in the help for options for the AutoCad Save As DXF command, "The default precision is usually adequate; however, you might need to increase this value for certain drawings or applications."
Related publishing formats from AutoDesk: Two proprietary formats with limited functionality have been developed by AutoDesk for publishing designs. DWF and DWFx are secure file formats developed to combine and publish rich 2D- and 3D-design data. They are highly compressed file formats suitable for distributing a single drawing or multiple drawings and sheet sets over the Internet for review by people without a CAD application. AutoDesk provides a free application, Autodesk Design Review, for this purpose. DWFx is a relatively new version of the DWF file format, based on Microsoft's XML Paper Specification (XPS). DWFX documents can be viewed and printed with the Microsoft XPS Viewer, distributed as part of the Windows operating system. See About DWF and DWFx Files.
The precursor to AutoCAD was Interact, written by Mike Riddle for early microcomputers, starting in 1977, and released as a product in 1979 for a system based on a Marinchip 9900 CPU, which had hardware multiplication. In 1981, Riddle and the principals of Marinchip Systems, John Walker and Dan Drake, joined about a dozen other people to found AutoDesk and rewrite the software for the IBM PC. See Mike Riddle's Prehistoric AutoCAD and interviews in 2005 with Mike Riddle from the Digibarn Computer Museum. The highly compressed form of the DWG format has its origins in the early days of personal computers.
AutoDesk released AutoCad 1.0 in December 1982. A chronology of AutoCAD software releases is at AutoCAD Release History; a section on DWG File History lists version codes for the DWG format. See How to find the format of a DWG or which version of AutoCAD was used to create/save a DWG for an explanation of how DWG version codes and AutoCAD release identifiers are stored in DWG files in the initial bytes in the file (readable as ASCII or Hex characters even though the file content is mainly in a compact binary form). New DWG versions have been introduced roughly every two or three years since 1990. The Wikipedia article for the DWG format also lists version codes back through version 1.0.