|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 January 2020, PRONOM had records for 19 chronological versions, none of which is publicly documented by AutoDesk. One more recent version, associated with AutoCAD 2018 through 2020, is in use. Autodesk lists past versions of DWG at AutoCAD Release History. 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 (RFS): Still Image Works. AutoCad is also an acceptable format for 2D and 3D Computer Aided Design vector images on the RFS. The U.S. Copyright Office accepts DWG and DWF formats for registration of architectural drawings. See eCO Acceptable File Types.|
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 2020].
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 January 2020, this document covers the DWG format from AutoCAD Release 13 through AutoCAD 2018 (AC1032). The AC1032 version of DWG has been used from AutoCAD 2018 through AutoCAD 2020.
The ODA is a non-profit technology consortium of 1200 member companies that support the development of tools and SDKs to allow members to read and write files in DWG and other formats. Membership is offered at a number of pricing levels, from a free educational option for qualified university programs through corporate memberships starting at $30,000 per year. All memberships allow use of the ODA's .dwg toolset.
The DWG format is very widely used. It is the native format for AutoCAD and other AutoDesk products. According to an AutoDesk blog post, 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 DWG toolset (formerly using the name Teigha) from the Open Design Alliance, such as Caddie, Bricsys products, 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. FME from Safe Software offers reader/writer modules for DWG employing the RealDWG code; see Autodesk AutoCAD DWG/DXF Reader/Writer. The RealDWG code is also used in Bentley's Microstation PowerDraft product; see RealDWG and Object Enablers and Save As DWG/DXF Options.
Source code for the Open Design Alliance's software tools and toolsets are available to ODA's founding and corporate members. ODA's Drawings SDK is based on software libraries formerly known as OpenDWG, DWGdirect, and Teigha. ODA states that it is committed to ensuring long-term access to critical CAD data and lists DWG among Formats Supported by ODA’s 100-Year Commitment. The IntelliCAD Technology Consortium (ITC) is a member of ODA (see Member Story: IntelliCAD Technology Consortium) and source code for the core IntelliCAD software is available to commercial members of ITC. The code used to read and write DWG files is presumably the same for both consortia. Comments welcome.
Open-source projects that aim to read and write DWG files include: GNU LibreDWG (a C library to handle DWG files), LibreCAD (an open-source 2D CAD application), and QCAD. 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." A new maintainer for LibreDWG did emerge and development has continued. Meanwhile, in May 2016, the LibreCAD blog announced the departure from the team of "a very valuable asset." Free Libre 2-D CAD overview offers a brief comparison in January 2020 of LibreCAD and QCAD. Another indication of the difficulty of supporting open source efforts or products that are distributed free, is that in 2019, it was announced that DraftSight, for which a single-user license had been available at no cost from 2010-2019 for Windows, MacOS and Linux, would no longer be available free or supported on platforms other than Windows. See January 2020 blog post from a user of DraftSight on Linux.
A number of free applications can be used to view DWG drawing files, including: ODA Viewer; ODA Drawings Explorer; and eDrawings Viewer from 3DS (also available in mobile version for iOS and Android). Free Viewers from AutoDesk, include the online Autodesk Viewer (free to use, but requires account registration) and DWG TrueView (for Windows only, see review of Autodesk DWG TrueView from Softonic).
Several archival organizations have listed DWG as preferred or acceptable for depositing or storing CAD drawings: Library and Archives Canada, the UK Data Service, UK Archaeology Data Service, and Data Archiving and Networked Services in the Netherlands. According to a webpage from December 2019 now available via Internet Archive, the National Archives of Australia listed DWG as as an acceptable format, based on wide usage and documentation by the Open Design Alliance. The National Archives of Australia currently lists DWG as an acceptable preservation format for born-digital files
|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 may be 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 created in AutoCAD. See Autodesk BIM Interoperability page and Autodesk BIM Interoperability Tools. In 2018, Autodesk introduced an Enhanced DWG Exporter for Revit. (This exporter is not currently listed on the Autodesk BIM Interoperability Tools webpage.) The Enhanced DWG Exporter for Revit was created in response to needs of the Austrian Government CAD standard ÖNORM 6241-1, but can be used to support compliance with any national or corporate CAD standard. 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 January 2020, 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. There is no PUID as of early 2020 for the version introduced with AutoCAD 2018.|
|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 used Reed-Solomon encoding to support error correction. However, this mechanism was dropped in subsequent versions.
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. Version 5.4.1 of the reverse-engineered Open Design Specification for DWG described these ACIS 3D objects in clause 20.4.41 and chapter 24, 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. In Support Both DWG and DXF Storage Formats, Autodesk states, "Autodesk is committed to supporting both DWG and DXF storage formats as logically equivalent in content. DWG is a proprietary binary format that offers superior I/O performance, while DXF is a published format intended to both minimize application parsing requirements and maximize compatibility with previously released products." 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 all versions of 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; interviews in 2005 with Mike Riddle from the Digibarn Computer Museum; and The Autodesk File: Bits of History, Words of Experience by John Walker. 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.