CNC File OptimizerG-code · STL CAM

About & help

CNC File Optimizer is a free tool that makes CNC programs smaller, faster and more compatible, and turns STL models into ready-to-run 3-axis toolpaths. It runs entirely in your browser: no file is ever uploaded, and once the page has loaded it works without a network connection.

Optimizing G-code

Drop any G-code file (.nc, .gcode, .tap, .ngc, .cnc, .txt, .mpf …). The file is read by a real modal interpreter — it tracks G0–G3, G90/G91, planes, units, arc-centre modes, canned cycles, cutter compensation, tool offsets and work offsets — so every move has a known start and end point before anything is changed. Then, depending on your settings:

Moves inside cutter compensation (G41/G42), incremental (G91) sections, canned cycles and unknown syntax are always passed through untouched.

The safety self-check

Every result is re-parsed and compared with the original program before you see it:

If any check fails the download button turns amber and the failing check is explained. Please review such a file before running it — or loosen the settings and run again. As with any CAM output, always dry-run new programs above the stock first.

STL to toolpaths

Drop an STL model (binary or ASCII). Tell the tool which way is up and what units the model uses, choose stock, a roughing tool and a finishing tool, and plan. You get:

Accuracy. Parallel finishing is computed with an exact drop-cutter against the model's triangles: the path stays within the path tolerance (0.01 mm by default) of the true tool-centre surface, and never below it, on flat, sloped and near-vertical faces alike; it is then verified by dense sampling against the same exact geometry. Roughing, waterline finishing and all linking moves use the conservative height-map bound, so vertical walls there are resolved to about 1.5 × the grid resolution. Use the “Fine” grid for small, detailed parts; “Auto” picks a cell size that keeps planning to a few seconds. Roughing leaves the configured stock for finishing; a warning tells you where the finishing tool has to cut deeper than the roughing terraces (features the roughing tool could not enter).

Supported controllers

The target controller sets comment style, canned-cycle and tool-length-offset support, program end and line numbering:

Presets, privacy, offline

Settings and named presets are stored in your browser only (localStorage); you can export and import them as JSON. The site sets no cookies and loads nothing from third parties. It is a static page — you can save it and run it from a folder.

Tips