Read DXF INSUNITS to Check Inches vs. Millimeters
Read the DXF INSUNITS header and line coordinates to check inches versus millimeters. Compare the implied length with a known dimension before changing scale.
On this page
- Read the units and coordinates separately
- Compare the same line with three headers
- Use a known length to check what the file means
- FAQ
- What do DXF INSUNITS values 0, 1, and 4 mean?
- Does changing INSUNITS from 1 to 4 convert a DXF to millimeters?
- What if the DXF file has no INSUNITS value?
- Start with source artwork if you need new paths
- Sources
If a DXF opens at the wrong size, read its $INSUNITS header and compare a raw distance with a dimension you trust. The same two drawing units can describe 2 mm or 2 inches, which is 50.8 mm. A 25.4× difference, or its reciprocal, is a clue that the source units may have been interpreted differently. NIST’s inch-to-millimeter conversion
Read the units and coordinates separately
$INSUNITS is a header variable that records drawing units for insertion scaling. In an ASCII DXF, open a copy in a text editor and look for $INSUNITS in HEADER. The next pair is group code 70 and its value. Three common values are 0 for unitless, 1 for inches, and 4 for millimeters. Autodesk DXF header reference
This excerpt declares inches.
9
$INSUNITS
70
1A LINE stores its start point in groups 10, 20, and 30 and its end point in groups 11, 21, and 31. Those coordinates supply the raw distance. The units value describes how to interpret that distance. For a horizontal line from X = 10 to X = 12, the raw length is 2 drawing units. Autodesk DXF LINE reference
If the field is absent or set to 0, use the sender's stated units or a dimension from an approved drawing to establish what the numbers mean. For a binary DXF, use a DXF-aware tool or ask the sender for an ASCII export.
Compare the same line with three headers
We wrote three minimal ASCII DXFs, each with one LINE from (10, 0, 0) to (12, 0, 0). A Python script read each header and calculated the endpoint distance. All three files had a raw length of 2 drawing units. The millimeter header implied 2 mm, the inch header implied 50.8 mm, and the unitless header gave no physical length on its own.

The figures show the raw coordinates at the same scale. The test covered header and geometry inspection. Import decisions depend on the receiver's software and settings.
Use a known length to check what the file means
- Choose one feature you can match to a drawing. Use a straight segment or the distance between two holes. Compare the same pair of points and write the reference length in millimeters.
- Calculate the raw distance from the coordinates. For the horizontal line above, subtract 10 from 12. Record 2 drawing units.
- Apply the declared unit for the comparison. A millimeter header gives 2 mm for that line. An inch header gives 50.8 mm. For a unitless file, ask the sender to confirm the intended unit if the reference dimension alone leaves it ambiguous.
- Compare the implied length with the reference. A match confirms that the coordinates and declaration agree for that feature. A mismatch gives you a concrete question for the sender. If needed, compare a second dimension on another axis before deciding that the whole file shares a scale factor.
For a reference of 50.8 mm, the inch-labeled example agrees with the drawing. The millimeter-labeled example implies a length 25.4 times smaller. If a receiver still displays 2 mm after the inch header checks out, look for the receiver’s source-unit setting. LightBurn documents automatic detection where possible and a manual DXF unit choice for files without unit information. LightBurn DXF import settings
For files you create yourself, the Inkscape PNG-to-DXF walkthrough shows how to establish the physical width before export. If the receiver accepts multiple formats, the SVG versus DXF laser workflow covers what to verify in each.
FAQ
What do DXF INSUNITS values 0, 1, and 4 mean?
0 means unitless, 1 means inches, and 4 means millimeters. In ASCII DXF, the number appears as the value for group code 70 under $INSUNITS.
Does changing INSUNITS from 1 to 4 convert a DXF to millimeters?
Editing the header changes the declared unit while the raw coordinates stay the same. To preserve the same physical size during a true inch-to-millimeter conversion, convert the geometry at 25.4 millimeters per inch and declare millimeters.
What if the DXF file has no INSUNITS value?
Ask the sender for the source units or get the expected length of a feature. Set the source units on import when your app allows it, then check the feature against the expected size.
Start with source artwork if you need new paths
PerfectVector can turn a flat raster logo or drawing into editable SVG paths. That helps if the DXF is missing and all you have is a bitmap. If you have the existing DXF and the geometry is intact, use the scale measurements above.
Vectorize the source image, then size the editable outline against a trusted dimension in your design app before exporting a new DXF.
Sources
- Autodesk — DXF HEADER section group codes — Defines group code 70 and the insertion unit values.
- Autodesk — DXF LINE group codes — Identifies the coordinate pairs used to compute the line length.
- NIST — SI units of length — Documents the exact 25.4 mm per inch conversion.
- LightBurn — DXF import settings — Explains automatic unit detection and selection when the file lacks usable units.
More from the blog
Is DXF a Vector File? How to Trace or Export It
DXF is a CAD vector format, but the extension alone does not guarantee usable geometry. Learn when to export, when to trace, and what to verify after import.
Indexed PNG vs. RGB PNG: Check Color and Alpha
Tell indexed PNG from RGB and RGBA PNG, check palette transparency, and see why changing the mode cannot restore a color removed from the palette.


