The percent sign at the top of your program is not a command, does not execute, and has no meaning to the cutting that follows. It is the edge of a paper tape, preserved in software for sixty years, and once you see it that way, every odd behavior associated with it, the loading quirks, the rewind failures, the transfer clips, becomes one story: something expected a boundary marker and did not find it.
What the marker meant on tape
A program on punched tape was a physical object with a physical problem: the reader needed to know where, on a long strip of paper, the program actually started and stopped. The percent character was the answer, a rewind-stop and boundary mark punched at each end, so the reader could find the beginning, and so end-of-program handling, including M30’s literal rewinding of the tape to the start marker, had a destination. Two percents, one program between them, anything outside the markers, labels, handling notes, tape-splicing scars, ignored by the reader.
Memory replaced tape; the choreography stayed. Fanuc-family conventions still bracket programs with percent signs, transfer modes still honor them, and G-code’s file format generally still behaves as if the file were a tape: which is why the marker’s absence can surface as edge-of-file misbehavior on controls that take the convention seriously.
What it does, and does not do, today
| Question | The answer | The consequence |
|---|---|---|
| Does it execute? | No: it is structure, not language | Deleting it changes no cut anywhere |
| Do controls require it? | Dialect-dependent: Fanuc-family conventions use it, others tolerate or ignore | Keep what your post emitted |
| What lives outside the markers? | Conventionally, ignored territory | Some workflows park file comments there |
| What breaks without it? | Edge handling: loading, rewind, transfers on convention-honoring setups | Including the stuck-at-M30 family |
| Does it pair? | Yes: the opening percent has a closing twin | A missing closer is the subtle half of the problem |
The pairing row earns emphasis because the closing percent fails quietly: a file whose tail lost its marker in an edit or transfer can load fine and misbehave only at the end, where M30’s rewind has its own suspect list with this exact character near the top. The dialect row resolves the same way every format question does: LinuxCNC documents an optional percent-delimited file form alongside the ordinary M2/M30 ending, Fanuc-family manuals state their own convention, and the file your post processor emitted is already correct for the machine it was posted for.
The practical rules
Three of them, all cheap. Leave the markers your post emitted: they cost one character each and removing them buys nothing. When assembling or editing files by hand, keep the brackets paired, one at the top, one at the end, the same file-tail awareness that keeps comments and end-of-block characters intact. And when a file misbehaves at its edges, loading oddly, ending oddly, transferring incompletely, inspect the first and last lines in a text editor before deeper diagnosis, because boundary problems live at boundaries.
The percent sign is also a pleasant little teacher: it is the most visible of several tape-era survivals, N numbers, end-of-block conventions, the rewind concept itself, that explain why this language’s file format feels the way it does. Programs are tapes that stopped being paper, and reading them with that history in mind makes the format’s quirks legible instead of arbitrary, the same way the rest of the core vocabulary becomes legible with recall practice: a few minutes a day, and the strange characters stop being strange.
Sources
Frequently asked questions
Why is there a percent sign at the top of my G-code file?
It is a file boundary marker inherited from punched tape, where it told the reader where the program began and ended. Fanuc-family conventions keep one at each end of the file, and everything outside the markers is conventionally ignored. It executes nothing.
What happens if I delete the percent signs from a program?
On forgiving controls, nothing. On convention-honoring controls and transfer setups, edge problems: odd loading, end-of-program misbehavior including failed rewinds, clipped transfers. The character costs nothing to keep.
Does the percent sign work the same on every control?
No: Fanuc-family controls bracket programs with percents, LinuxCNC documents an optional percent-delimited form, hobby controllers largely ignore it. Your control’s documentation is the authority; the safe practice is leaving what your post emitted.
Why do old conventions like this survive in modern G-code?
Because keeping them costs one character and breaking them costs compatibility with decades of machines, programs, and transfer tooling. The format ossified around what worked on tape.