Markdown copy of https://cadquill.com/delete-duplicate-lines-dxf/ (a CADQuill guide, language: en), from cadquill.com.

# 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

Open your DXF or DWG file

The file opens in the editor in this browser: it is not uploaded.

## Two ways

1. Open the DXF or DWG in the [editor](https://cadquill.com/app/).
2. **With the assistant:** write "delete the duplicate lines" and send it.
3. **Without it:** press **Script** in the bottom toolbar, type the line below and press **Run**.
4. 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.
5. 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](https://cadquill.com/free-online-cad/).
- 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](https://cadquill.com/prepare-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](https://cadquill.com/dwg-viewer/)
- [A free online CAD, in your browser](https://cadquill.com/free-online-cad/)
- [Convert DWG to DXF online](https://cadquill.com/dwg-to-dxf/)
- [Convert DWG to PDF online](https://cadquill.com/dwg-to-pdf/)
- [Convert DXF to DWG online](https://cadquill.com/dxf-to-dwg/)
- [Edit a DWG without AutoCAD](https://cadquill.com/edit-dwg-without-autocad/)
- [A free DXF editor, in your browser](https://cadquill.com/dxf-editor/)
- [Open and edit a DXF file online](https://cadquill.com/dxf-viewer/)
- [Convert a DXF or DWG from inches to millimetres](https://cadquill.com/dxf-inches-to-mm/)
- [Change a text in a DWG or DXF](https://cadquill.com/change-text-in-dwg/)
- [Fix overlapping texts and dimensions in a DWG or DXF](https://cadquill.com/fix-overlapping-text-dxf/)
- [Add dimensions to a DWG or DXF](https://cadquill.com/add-dimensions-dxf/)
- [Prepare a DXF for laser cutting](https://cadquill.com/prepare-dxf-for-laser-cutting/)
- [AutoCAD alternatives for DWG files: how CADQuill compares](https://cadquill.com/autocad-alternatives-browser/)
- [Text to DXF and DWG: describe a drawing, get a CAD file](https://cadquill.com/text-to-dxf/)
- [Put one part in front of another, without masks](https://cadquill.com/remove-hidden-lines-dwg/)
- [Open a DWG on a Mac, a Chromebook, Linux or an iPad](https://cadquill.com/open-dwg-on-mac/)
- [Convert DXF to PDF online](https://cadquill.com/dxf-to-pdf/)
- [Convert DXF or DWG to SVG online](https://cadquill.com/dxf-to-svg/)
- [Convert DWG or DXF to PNG online](https://cadquill.com/dwg-to-png/)
- [Convert DWG or DXF to STL, OBJ, GLB or STEP](https://cadquill.com/dwg-to-stl/)
- [Convert to DXF R12 online](https://cadquill.com/dxf-r12-converter/)
- [Save a drawing for an older AutoCAD](https://cadquill.com/dwg-to-older-version/)
- [Measure a DWG or DXF online](https://cadquill.com/measure-dwg-online/)
- [An AI assistant for DWG and DXF drawings](https://cadquill.com/ai-assistant-dwg/)
- [Text to 3D CAD: describe a part, get a STEP file](https://cadquill.com/text-to-step/)
- [Sketch to 3D model](https://cadquill.com/sketch-to-3d-model/)
- [Free 3D CAD online](https://cadquill.com/free-3d-cad-online/)
- [STEP viewer online, free](https://cadquill.com/step-viewer/)
- [STL viewer online, free](https://cadquill.com/stl-viewer/)
- [3MF viewer online, free](https://cadquill.com/3mf-viewer/)
- [OBJ viewer online, free](https://cadquill.com/obj-viewer/)
- [Convert STL to STEP online](https://cadquill.com/stl-to-step/)
- [Convert STEP to STL online](https://cadquill.com/step-to-stl/)
- [Convert OBJ to STL online](https://cadquill.com/obj-to-stl/)
- [Convert 3MF to STL online](https://cadquill.com/3mf-to-stl/)
- [Convert STL to OBJ online](https://cadquill.com/stl-to-obj/)
- [Convert STEP to OBJ online](https://cadquill.com/step-to-obj/)
- [Convert OBJ to STEP online](https://cadquill.com/obj-to-step/)
- [Convert STL to 3MF online](https://cadquill.com/stl-to-3mf/)
- [Convert STEP to 3MF online](https://cadquill.com/step-to-3mf/)
- [PDF to 3D model](https://cadquill.com/pdf-to-3d-model/)
- [AI CAD generator](https://cadquill.com/ai-cad-generator/)
- [Examples: one message, and what came out](https://cadquill.com/examples/)

Last changed on 2026-11-27.
