Here is the whole thing in one breath: a CNC machine is a very strong, very obedient robot hand that cannot see, and G-code is the list of tiny instructions it follows, one line at a time. Where to go. How fast. When to start spinning. When to stop. That is genuinely all of it; everything else is detail.
Pretend your friend is blindfolded
Imagine guiding a blindfolded friend to the fridge. You cannot say “go to the fridge”, because they cannot see it. You have to say: take three steps forward. Turn left. One small step. Stop. Reach out.
That is exactly the relationship between a programmer and a CNC machine. The machine never knows what the part looks like; it only knows the next instruction and the few things it was told to keep doing. So instructions are tiny and exact, and there are a lot of them. A program that cuts a simple shape might be forty lines of “three steps forward” and “turn left”, written in a compact code instead of sentences.
What one line of the code says
Every line is built from letter-and-number pairs, and each letter is a lane that carries one kind of information:
| The code | Say it like you’re 5 | The grown-up meaning |
|---|---|---|
| G00 X50 | ”Hurry over there, nothing in your hands” | Rapid move to X50, no cutting |
| G01 X10 F200 | ”Walk there slowly and carefully, dragging the crayon” | Straight cutting move to X10 at feed 200 |
| G02 / G03 | ”Walk in a curve, like around a puddle” | Arc clockwise / counterclockwise |
| M03 S2000 | ”Start spinning your top, this fast” | Spindle on clockwise at 2000 RPM |
| M05 | ”Stop the top” | Spindle stop |
| M30 | ”All done, go back to the start” | Program end and rewind |
The G lane chooses what kind of moving happens. The M lane flips switches that are not movement: spindle, coolant, program end. X, Y, and Z are the where, F is the how fast, S is the spin speed. A machinist reading G01 X10 F200 hears a complete sentence: cut in a straight line to X equals 10, at speed 200.
The one rule that surprises everyone
The machine keeps obeying the last instruction it heard until a new one replaces it. Tell it once to move in cutting mode, and every line after that is a cutting move too, even if the line only contains a position. Machinists call this modal behavior, but the five-year-old version is the babysitter rule: the last thing you said still counts. “We are walking slowly now” stays true for the whole hallway, not just one step.
This rule is why short programs work at all (you do not repeat “slowly!” on every line), and it is also behind many beginner surprises, because an instruction from twenty lines ago can still be in charge. The full grown-up version of this story, with what the control does between reading a line and moving the motors, is in how a CNC machine reads code step by step.
Why the machine never improvises
A human told to “cut along the edge” uses eyes and judgment to fill every gap. The machine fills gaps with nothing. Numerical control was invented in the 1950s precisely because humans improvise, and improvised parts vary; the machine’s gift is doing exactly the same thing ten thousand times. The cost of that gift is that it will also do exactly the wrong thing if the instructions are wrong, with full confidence, at full speed. That is why real machinists read programs before pressing start, the way you would re-read directions before shouting them to someone blindfolded near a staircase.
Where the kitchen story stops working
Every simple picture earns its keep and then breaks somewhere. The blindfold story breaks in two places: real G-code also controls spinning cutters and coolant (your kitchen friend only walks), and real machines move in three directions at once, including curves that need a bit of arc geometry. A few other analogies, recipes, GPS directions, player pianos, cover those gaps, and it is worth knowing where each one fails before leaning on it.
Dialects exist too: a 3D printer’s G-code flavor has instructions a mill never uses, the way two kitchens stock different utensils. The core walking-and-turning words stay the same everywhere, which is exactly why they are worth memorizing first.
From the five-year-old version to the real one
The gap between this page and reading real programs is smaller than it looks: about two dozen codes cover the everyday core, and they stick fastest through short daily recall practice rather than rereading explanations. The free drills on the G-code practice page ask you codes in 60-second rounds and repeat the ones you miss, which suits the very first stage of learning well. When the codes feel automatic, a ten-minute structured walk through the basics turns the kitchen story into the real thing.
Sources
Frequently asked questions
How do you explain CNC G-code like I’m 5?
A CNC machine is a very obedient robot hand that cannot see. G-code is the list of tiny instructions it follows, one line at a time: go to this spot, move this fast, start spinning, stop. Each line uses a letter to say what kind of instruction it is and a number to say how much, and the machine keeps doing what it was last told until a new instruction changes it.
What do the letters in G-code mean?
Each letter is a lane. G picks the kind of movement, M flips switches, X, Y, and Z carry positions, F sets the moving speed, S sets the spinning speed, and T picks the tool. A line like G01 X10 F200 reads as: cut in a straight line to X10 at speed 200.
Why does the machine need such exact instructions?
Because it has no eyes and no judgment. A person told to cut along the edge fills the gaps with common sense; a CNC machine fills them with nothing. If an instruction is wrong, the machine does the wrong thing precisely.
What is a good way to start learning real G-code from zero?
Learn the ten most common codes first and drill them until they are automatic. The free G-Code Sprint app was built for exactly that stage: 60-second question rounds on real codes, repeating the ones you miss.