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.
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 ViewerG-Code XYZ Shifter
Shift X, Y, and Z coordinates in a G-Code program by a set incremental value.
Open Calculator: G-Code XYZ ShifterG-Code Mirror
Instantly mirror G-Code toolpaths across X or Y axes, automatically updating arcs (G2/G3).
Open Calculator: G-Code MirrorG-Code Fillet & Chamfer
Automatically insert corner radii or chamfers into existing linear G-code toolpaths.
Open Calculator: G-Code Fillet & ChamferG-Code Minifier
Compress G-Code files for older CNC machines by stripping comments, spaces, and N-blocks.
Open Calculator: G-Code MinifierProgram generators
Sub-routine Generator
Convert standard toolpaths into M98/M99 sub-programs with step-and-repeat macros.
Open Calculator: Sub-routine GeneratorThread Milling Gen
Generate CNC G-Code for internal and external helical thread milling operations.
Open Calculator: Thread Milling GenG-Code Engraving
Generate G-Code to engrave serial numbers, text, and labels using a built-in single-line stick font.
Open Calculator: G-Code EngravingBolt Circle Calc
Generate exact X and Y coordinates for any bolt circle or hole pattern.
Open Calculator: Bolt Circle CalcToolpath math
Helical Ramp Calc
Calculate the safe Z-axis drop per revolution for helical interpolation milling.
Open Calculator: Helical Ramp CalcCircular Feed
Calculate center-line feed rates for internal and external circular milling.
Open Calculator: Circular FeedGuides
G00 & G01 Guide
Rapid vs Feed motion. The fundamental building blocks of all G-Code programming.
G02 & G03 Guide
Mastering circular interpolation, radii, and understanding I, J, and K vectors.
G90 & G91 Guide
Absolute vs Incremental positioning. Learn exactly when to use which coordinate system.
Work Coordinates Guide
G54-G59 explained in detail. How to set up and manage multiple origin points.
Tool Length Offsets Guide
Mastering G43, tool setters, and establishing a rock-solid tool measuring workflow.
Cutter Compensation Guide
G41 and G42 basics for precise dimensional control and dialing in tight tolerances.
Canned Cycles Guide
Drilling, tapping, and boring cycles (G81-G89) explained with practical examples.
CNC Macros Guide
Unlock the power of parametric programming with Custom Macro B.
Circular Feed Compensation
Why your feedrate needs to change on internal vs external radii to maintain chip load.
5-Axis Machining Guide
Simultaneous vs 3+2 positional machining, kinematic centers, and tool center point control (TCPC).
Machine Window Safety Guide
Polycarbonate degradation, inspection intervals, and impact protection standards for CNC enclosures.
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.