CNC Programming & G-Code Tools

Most CNC programs come out of CAM software, but the job is not done when the post processor finishes. You still have to read the code, check it and fix small things at the machine. This hub collects the free tools and guides on Machinist Central that help with that work.

The G-code utilities run in your browser. Paste a program into the 3D viewer to see the toolpath before you press cycle start. Shift a program to a new zero, mirror it for a left-hand part, add corner chamfers, or strip comments so a big file fits in an older control's memory.

The generators write short programs for jobs that CAM often makes awkward: helical thread milling, engraving serial numbers, M98/M99 subroutines and bolt hole patterns. The math tools handle helical ramp entry and the feed correction you need when cutting around an arc.

If you are learning, start with the guides. They explain rapid and feed moves, arcs, absolute and incremental mode, work offsets, tool length offsets, cutter compensation, canned cycles and Custom Macro B. The G & M code chart is a quick lookup when you meet a code you do not know.

Always prove out new code with care. Run it the first time with single block, reduced rapids and the tool well above the part.

11 calculators 11 guides 3 charts

Start here

Calculators

Free, browser-based and no sign-up needed.

Edit and check G-code

G-Code 3D Viewer

Interactive 3D simulation of G-code toolpaths, with full support for drilling canned cycles.

Open Calculator: G-Code 3D Viewer

G-Code XYZ Shifter

Shift X, Y, and Z coordinates in a G-Code program by a set incremental value.

Open Calculator: G-Code XYZ Shifter

G-Code Mirror

Instantly mirror G-Code toolpaths across X or Y axes, automatically updating arcs (G2/G3).

Open Calculator: G-Code Mirror

G-Code Fillet & Chamfer

Automatically insert corner radii or chamfers into existing linear G-code toolpaths.

Open Calculator: G-Code Fillet & Chamfer

G-Code Minifier

Compress G-Code files for older CNC machines by stripping comments, spaces, and N-blocks.

Open Calculator: G-Code Minifier

Program generators

Sub-routine Generator

Convert standard toolpaths into M98/M99 sub-programs with step-and-repeat macros.

Open Calculator: Sub-routine Generator

Thread Milling Gen

Generate CNC G-Code for internal and external helical thread milling operations.

Open Calculator: Thread Milling Gen

G-Code Engraving

Generate G-Code to engrave serial numbers, text, and labels using a built-in single-line stick font.

Open Calculator: G-Code Engraving

Bolt Circle Calc

Generate exact X and Y coordinates for any bolt circle or hole pattern.

Open Calculator: Bolt Circle Calc

Toolpath math

Helical Ramp Calc

Calculate the safe Z-axis drop per revolution for helical interpolation milling.

Open Calculator: Helical Ramp Calc

Circular Feed

Calculate center-line feed rates for internal and external circular milling.

Open Calculator: Circular Feed

Guides

Reference charts

Frequently asked questions

What is the difference between G90 and G91?
G90 is absolute mode. Every coordinate is measured from the active work offset, such as G54. G91 is incremental mode. Each coordinate is a distance from where the tool is now. Most programs run in G90 and switch to G91 only for short moves.
What do G54 to G59 do?
They select a work coordinate system. Each one stores the distance from machine zero to a part zero that you set, so one program can run on parts held in different places on the table.
Can I check G-code before running it on the machine?
Yes. Paste the program into the G-Code 3D Viewer to see the toolpath, including drilling canned cycles. Then prove it out on the machine with single block and reduced rapids.
What are M98 and M99 used for?
M98 calls a subprogram and M99 ends it and returns to the main program. They let you repeat the same toolpath at several locations or depths without copying the code.