What Is a DXF File?
Upload your image to convert to DXF
Drag & drop or click — PNG, JPG, WebP up to 25MB
One watermarked preview a day, without an account. The clean DXF: $6.99 for that one file, or 25 files for $7.99 a month with the Starter plan.
A DXF file is a drawing in the Drawing Exchange Format of AutoCAD, most often saved as plain text: pairs of lines, a numbered code and then its value, that describe lines, arcs, circles and curves by their coordinates, layer by layer. Laser, CNC router and plasma shops ask for DXF because their software turns those shapes into cutting paths. To get one from a logo or a sketch, drop the picture in the box.
- Traces a PNG, JPG or WebP of a logo, a sign or a sketch into a DXF
- Writes AutoCAD R12 with coordinates in millimeters, one layer per color of the picture
- Shows the traced shapes in a watermarked preview before you pay
A DXF file, opened in a text editor
This is sign-plate-r12.dxf: a 100 x 50 mm sign plate drawn as an SVG, then written by the DXF writer of the site with the settings of the converter on this page. From a picture, the converter traces the shapes first, then writes them with the same settings. A DXF is read two lines at a time: a group code, then its value. First the header, where the file keeps its settings; then the first outline, the edge of the plate.
| Line | Code | Value | What it says |
|---|---|---|---|
| 1 | 0 | SECTION | A section starts. |
| 3 | 2 | HEADER | This one is the header, the file settings. |
| 5 | 9 | $ACADVER | Setting: the DXF version. |
| 7 | 1 | AC1009 | AC1009 is the code of AutoCAD R11 and R12. |
| 9 | 9 | $INSUNITS | Setting: the drawing units. R12 itself does not define it; the DXF viewer of the site reads it anyway. |
| 11 | 70 | 4 | 4 means millimeters. |
| 13 | 9 | $MEASUREMENT | Setting: metric or imperial. R12 does not define this one either. |
| 15 | 70 | 1 | 1 means metric. |
| Line | Code | Value | What it says |
|---|---|---|---|
| 103 | 0 | POLYLINE | An outline starts: the edge of the plate. |
| 105 | 8 | COLOR_1F2937 | Its layer, named after the plate color in the drawing, #1f2937. |
| 107 | 62 | 1 | Color 1 of the AutoCAD palette, red: the first color of the list the writer hands out to its layers in turn, not the color of the drawing. |
| 109 | 66 | 1 | A flag: its points follow, as VERTEX entities. |
| 111 | 10 | 0.0 | X of a placeholder point, always 0 in a POLYLINE. |
| 113 | 20 | 0.0 | Its Y, always 0 too. |
| 115 | 30 | 0.0 | Its Z is the elevation of the outline: 0, it lies flat. |
| 117 | 70 | 1 | 1 means closed. |
| 119 | 0 | VERTEX | The first point of the outline. |
| 121 | 8 | COLOR_1F2937 | On the same layer. |
| 123 | 10 | 5.0000 | X: 5 mm in, where the top edge leaves the rounded corner. |
| 125 | 20 | 50.0000 | Y: 50 mm up, the top edge. |
| 127 | 30 | 0.0 | Z: 0. |
The file goes on like this for 966 lines: a header section of 54 lines, a tables section of 44 lines that holds the layer table, an entities section of 866 lines that holds the 4 outlines and their 78 points, then 0 and EOF to close the file.
The group codes in these extracts
A code takes its meaning from where it sits. Here is what each one carries in the lines above.
- 0
- Starts something: here a section, or an entity such as POLYLINE, VERTEX or LWPOLYLINE.
- 1
- A text value: here the version code, AC1009.
- 2
- A name: here the name of a section, HEADER. Further on in the R12 file, it names the other two sections, the layer table and each layer.
- 9
- In the header: the name of a setting, such as $INSUNITS.
- 8
- In an entity: the layer it sits on.
- 10, 20, 30
- X, Y and Z of a point.
- 62
- A color number: here color 1 of the AutoCAD palette.
- 66
- In a POLYLINE: its points follow, as VERTEX entities.
- 70
- A whole number read by place: after $INSUNITS a unit code, after $MEASUREMENT 1 for metric, in an outline 1 for closed.
- 90
- In a LWPOLYLINE: how many points it holds.
- 5, 330, 100
- In the AutoCAD 2000 extract: a handle, the handle of the owner, a subclass marker.
Three real DXF files to download
The plate was drawn for this page as an SVG (sign-plate.svg, 465 bytes): a 100 x 50 mm outline with 5 mm rounded corners, two holes 5 mm across and a star to engrave, in two colors. The DXF writer of the site, the code behind the converter on this page and the SVG to DXF converter, turned it into these three files, and each one passes a strict read and audit by ezdxf, an open-source DXF library, with no error. Every number in the table is read from the files.
| DXF file | Written by | Version | Units | Layers | Entities | Drawing size | Lines |
|---|---|---|---|---|---|---|---|
| sign-plate-r12.dxf4,912 bytes | The DXF writer of the site, with the settings of the converter on this page | R12 (AC1009) | Millimeters ($INSUNITS 4) | COLOR_1F2937, COLOR_0090FF | 4 POLYLINE, 78 VERTEX, 4 SEQEND | 100 x 50 mm | 966 |
| sign-plate-2000.dxf15,861 bytes | The SVG to DXF converter, default settings | AutoCAD 2000 (AC1015) | Millimeters ($INSUNITS 4) | 0 | 4 LWPOLYLINE | 100 x 50 mm | 3,166 |
| sign-plate-inches.dxf15,740 bytes | The SVG to DXF converter, units set to Inches | AutoCAD 2000 (AC1015) | Inches ($INSUNITS 1) | 0 | 4 LWPOLYLINE | 3.937 x 1.9685 in | 3,166 |
Layers are the ones that hold the drawing, in file order. Entities count each 0 code of the ENTITIES section. Units are what the $INSUNITS line of each file says: R12 does not define that line, and the DXF reader of the site reads it in all three. The drawing size is what that reader measures, in the unit of the file.
The drawing these three files come from: sign-plate.svg, 465 bytes.
Curves: cut into short straight sides
A circle, from a picture or an SVG
16 sides, every corner 2.5 mm from the center
In the sign plate, each 5 mm hole is a closed outline of 16 straight sides. The sides fall inside the true circle by 0.048 mm at most, under the 0.05 mm the DXF writer of the site allows when it simplifies a curve.
Rounded corners
36 points: 9 for each corner
Each 5 mm corner of the plate became 8 short sides. That is why the edge of the plate holds 36 points for a shape with 4 straight edges.
No curve entity in these files
R12: POLYLINE and VERTEX | AutoCAD 2000: LWPOLYLINE | no bulge (42)
All three files hold straight sides only: no CIRCLE, ARC or SPLINE entity, and no outline has a bulge, the code 42 that bends a side into an arc. The format has those curves, CIRCLE and ARC in both versions and SPLINE in AutoCAD 2000 but not in R12, and they keep a curve exact. The two converters named on this page do not write them.
R12 or AutoCAD 2000: one plate, two versions
sign-plate-r12.dxf and sign-plate-2000.dxf hold the same four closed outlines and the same 78 points, and the DXF reader of the site measures the same 100 x 50 mm in both. What changes is the wrapping, and the layers: the R12 file has the settings of the converter on this page, one layer per color, and the AutoCAD 2000 file the default settings of the SVG to DXF converter, everything on layer 0.
R12 (AC1009)
- 3 sections: HEADER, TABLES and ENTITIES
- 1 table, for the layers
- Each outline is a POLYLINE, then one VERTEX entity per point, then a SEQEND: 86 entities for 4 outlines
- No handles
- 4,912 bytes, 966 lines
AutoCAD 2000 (AC1015)
- 6 sections: HEADER, CLASSES, TABLES, BLOCKS, ENTITIES and OBJECTS
- 9 tables, from VPORT to BLOCK_RECORD
- Each outline is one LWPOLYLINE that lists its points; code 90 gives how many, 36 for the edge of the plate
- 53 objects with a handle, the ID the others use to point at them (code 5, or 105 for the dimension style)
- 15,861 bytes, 3,166 lines
| Line | Code | Value | What it says |
|---|---|---|---|
| 1771 | 0 | LWPOLYLINE | The same edge of the plate, as one entity. |
| 1773 | 5 | 33 | Its handle, the ID other objects use to point at it. |
| 1775 | 330 | 17 | The handle of its owner: 17, the block record of *Model_Space, the model space where the drawing sits. |
| 1777 | 100 | AcDbEntity | A subclass marker. |
| 1779 | 8 | 0 | The layer: 0, the default one. |
| 1781 | 100 | AcDbPolyline | A second subclass marker. |
| 1783 | 90 | 36 | It holds 36 points. |
| 1785 | 70 | 1 | Closed. |
| 1787 | 10 | 5.0000 | X of the first point. |
| 1789 | 20 | 50.0000 | Its Y. The other 35 points follow, two pairs each. |
The outlines themselves take 860 lines in the R12 file and 376 in the AutoCAD 2000 file. The 2000 file is the larger one because of its 906-line header section, its tables and its objects. Send the version the shop or its software asks for. The converter on this page writes R12, the version older CAM programs read too; the SVG to DXF converter writes AutoCAD 2000 unless you pick R12, the option it labels for ESPRIT 2020 and old Mastercam.
Units: one header line, which R12 does not define
In an AutoCAD 2000 file, the header setting $INSUNITS names the unit: 4 for millimeters, 1 for inches. sign-plate-inches.dxf is the same plate with 1 there and every number divided by 25.4: the plate is 3.937 inches wide, and its first point is 0.1969, 1.9685 instead of 5, 50.
Read in the wrong unit
Read as inches, the millimeter plate would be 2,540 mm wide. Read as millimeters, the inch file would make it 3.937 mm wide.
No unit line
When a DXF has no $INSUNITS, or sets it to 0, the program that opens it has to guess, and the DXF viewer of the site shows "no units set".
In an R12 file
R12 does not define $INSUNITS. The two converters named on this page still write it in every file, R12 included: millimeters, unless you choose centimeters or inches in the SVG to DXF converter. The DXF viewer of the site reads it in R12 files too; a program that keeps to R12 gets plain numbers, so tell the shop the unit.
Four ways to get the DXF a shop asks for
From a picture
The converter at the top of this page traces a PNG, JPG or WebP into an R12 DXF with coordinates in millimeters.
Go to the converterFrom an SVG
When the drawing is already a vector, the free SVG to DXF converter writes the DXF in your browser, in R12 or AutoCAD 2000, at its true size: the 100 mm plate of this page came out 100 mm wide.
SVG to DXF converterPrepared for you
When a picture needs more than tracing, the DXF conversion service prepares the file for laser, CNC or plasma, with a quote before you pay.
DXF conversion serviceAlready have one
Open it in the DXF viewer to see the drawing with its units, size and layers, read in your browser.
DXF viewerHow to make a DXF file from a picture
- 1
Drop your picture
Put the PNG, JPG or WebP of the logo, sign or sketch in the box at the top of this page, then press Convert to DXF.
- 2
Check the traced shapes
The preview shows every shape that will be in the DXF, under a watermark. Each color of the picture becomes its own layer.
- 3
Download the DXF
Download DXF File opens the payment options. The file is AutoCAD R12 with coordinates in millimeters. Its header says so in a $INSUNITS line, which R12 does not define: tell the shop the unit as well.
DXF file questions
What does DXF stand for?
Drawing Exchange Format: the format AutoCAD uses to pass a drawing to other programs. Its versions are named after AutoCAD releases, such as R12 (code AC1009) and AutoCAD 2000 (code AC1015).
Is a DXF a vector file?
Yes. It stores coordinates, not pixels: the top edge of the sign plate runs from X 5, Y 50 to X 95, Y 50. It stays sharp at any size, and a machine can follow it.
What opens a DXF file?
CAD programs such as AutoCAD and Fusion 360, design programs such as Inkscape and CorelDRAW, and laser software such as LightBurn: the programs the DXF of this page is made for. The DXF viewer of the site shows one in the browser, with nothing to install.
What is the difference between DXF and DWG?
DWG is the native drawing format of AutoCAD, saved in binary. DXF is its exchange format, most often saved as text you can read, like the files on this page. The DXF tools of the site read text DXF only: save a DWG as DXF in your CAD program first.
Why did my DXF import at the wrong size?
Look at the units. A DXF without a $INSUNITS line, or with 0, leaves your software to guess, and a guess of inches turns the 100 mm plate into a part 2,540 mm wide. R12 does not define that line at all, so with an R12 file, tell the shop the unit. The DXF viewer of the site shows the unit a file declares.
Which DXF version should I send to a laser or CNC shop?
The one their software asks for. R12 is the older version that legacy CAM programs read too, and it is what the converter on this page writes. An AutoCAD 2000 file can hold LWPOLYLINE and SPLINE entities, which R12 does not have, and it is the default of the SVG to DXF converter.
Why are the circles in my DXF made of straight lines?
Because the program that wrote it turned each curve into short straight sides, as the two converters named on this page do. In the sign plate, 16 sides make each 5 mm hole and 8 sides each rounded corner, within 0.05 mm of the true curve. A DXF can also keep a curve exact, as a CIRCLE, an ARC or, in AutoCAD 2000, a SPLINE entity, when the program that writes it uses them.
Can I make a DXF from a JPG or PNG?
Yes: drop it in the box at the top of this page. You see the traced shapes in a watermarked preview, one a day without an account. The clean DXF costs $6.99 for that one file, or 25 files for $7.99 a month with the Starter plan.
More: DXF viewer, free SVG to DXF converter, DXF conversion service and all VectoSolve tools.
