Delete duplicate lines in a DXF or DWG
Open the drawing in the editor and remove everything drawn twice in one step: lines, arcs, circles and polylines that lie exactly on another, and lines of zero length. You see what goes before you apply it, and the file is never uploaded.
Drop a DWG or DXF file here, or
The file opens in the editor in this browser: it is not uploaded.
Two ways
- Open the DXF or DWG in the editor.
- With the assistant: write "delete the duplicate lines" and send it.
- Without it: press Script in the bottom toolbar, type the line below and press Run.
- The preview says how many objects go ("Removed 6 duplicates") and marks them on the drawing. Press Apply to keep the change or Discard to drop it.
- Press Download and save the drawing as DXF or DWG.
ops.dedupe(doc);
What counts as a duplicate
- Two objects with the same geometry: a line on a line, an arc on an arc, a circle on a circle, a polyline on a polyline, also when one was drawn in the other direction.
- "The same" means closer than 0.001 of a drawing unit. A copy that is further off, even by a hair, stays; widen the margin with
ops.dedupe(doc, { tol: 0.01 }). - Texts with the same content in the same place, and blocks inserted twice at the same spot, count too.
- Lines and polylines of zero length go too: they are points a cutter would still visit.
- One of each pair stays. Its layer and colour are not changed.
In our test drawing of a plate with 27 objects, one run removed 6: four exact copies and two lines drawn the other way round. A circle 0.001 mm off its twin stayed, and went with the wider margin.
Limits
- A short line lying on a longer one, and two lines that overlap only for a part of their length, are not removed: neither is a copy of the other. Ask the assistant to join them, or fix them yourself in the 2D CAD's Full mode.
- A shape drawn once as a polyline and once as separate lines is not seen as a duplicate.
- It works on the model space: what is inside blocks and on sheets is left as it is.
For the other things a cutter needs (closed contours, units, layers), see prepare a DXF for laser cutting.
Questions
Is the drawing uploaded?
No. It is opened, cleaned and saved in your browser.
Can I see what will be deleted first?
Yes. The preview marks the objects that go and says how many. Nothing changes until you press Apply, and Undo takes it back.
Does it work on a DWG?
Yes. A DWG is converted in your browser when it opens, and you can save the result as DWG or DXF.
Why does my laser still cut a line twice?
Probably two lines overlap only in part, or a short one lies on a long one. Those are not exact duplicates and stay; see Limits.
More guides
- Open a DWG file online, without AutoCAD
- A free online CAD, in your browser
- Convert DWG to DXF online
- Convert DWG to PDF online
- Convert DXF to DWG online
- Edit a DWG without AutoCAD
- A free DXF editor, in your browser
- Open and edit a DXF file online
- Convert a DXF or DWG from inches to millimetres
- Change a text in a DWG or DXF
- Fix overlapping texts and dimensions in a DWG or DXF
- Add dimensions to a DWG or DXF
- Prepare a DXF for laser cutting
- AutoCAD alternatives for DWG files: how CADQuill compares
- Text to DXF and DWG: describe a drawing, get a CAD file
- Put one part in front of another, without masks
- Open a DWG on a Mac, a Chromebook, Linux or an iPad
- Convert DXF to PDF online
- Convert DXF or DWG to SVG online
- Convert DWG or DXF to PNG online
- Convert DWG or DXF to STL, OBJ, GLB or STEP
- Convert to DXF R12 online
- Save a drawing for an older AutoCAD
- Measure a DWG or DXF online
- An AI assistant for DWG and DXF drawings
- Text to 3D CAD: describe a part, get a STEP file
- Sketch to 3D model
- Free 3D CAD online
- STEP viewer online, free
- STL viewer online, free
- 3MF viewer online, free
- OBJ viewer online, free
- Convert STL to STEP online
- Convert STEP to STL online
- Convert OBJ to STL online
- Convert 3MF to STL online
- Convert STL to OBJ online
- Convert STEP to OBJ online
- Convert OBJ to STEP online
- Convert STL to 3MF online
- Convert STEP to 3MF online
- PDF to 3D model
- AI CAD generator
- Examples: one message, and what came out
Last changed on 2026-11-27.