G-code translator and toolpath preview
Paste CNC G-code (LinuxCNC) or 3D-printer G-code (Marlin) and read it as plain English, next to a top-down toolpath preview. Everything runs in your browser, with no upload and no logging.
G-code source
gcode / nc / tapTranslates as you type. Inline (parens) and ; end-of-line comments pass through.
Stats
axis units = whatever the file uses- Lines
- 0
- Blocks
- 0
- G / M codes
- 0 / 0
- Comments
- 0
- Layers (Z)
- 0
- Est. time
- -
- Shapeoko stock GRBL
- X range
- -
- span -
- Y range
- -
- span -
- Z range
- -
- span -
- Cut path
- -
- Travel
- -
- Extruder
- -
Line by line
Decoded breakdown will appear here as you type.
What this tool does
G-code is the list of commands a CNC machine or a 3D printer runs, one line at a time. Each line has a code such as G1 (move in a straight line) or M3 (start the spindle), and parameters such as X10 or F600. This page reads each line and says in plain words what it does. It also counts the job and draws the path the tool takes, seen from the top.
It knows over 300 G and M codes from the LinuxCNC reference and the Marlin firmware. That includes codes with a decimal point (G5.1, G38.2, G91.1) and letters that mean different things per machine (E for filament, S for a fan, heater or spindle). Pick the dialect so the words match your machine.
When to use it
- Before you run a file you did not write. Check the units, the start height and the spindle or heater commands before the machine moves.
- To find where a job goes wrong. Read the lines around the problem in plain words.
- To check the size of a job. The X, Y and Z ranges show if the part fits on the bed or the stock.
- To learn G-code. Load a sample and read each line next to its meaning.
What you see
- Stats: lines, blocks, G and M code counts, comments, layers, the X, Y and Z ranges, the cut or extrude length, the travel length and an estimated time.
- Line by line: each line with every code and parameter explained. Comments in brackets and after
;are kept. - Toolpath: travel moves (
G0) and cut or extrude moves (G1,G2,G3) in two colours. Arcs work with centre offsets (I,J) and with a radius (R). Drag to pan, and pinch or use the wheel to zoom.
Worked examples
G21 G90 G17sets millimetres, absolute positions and the XY plane.G1 X10 F600 ; first cutis a straight move to X 10 at 600 units a minute, with the comment "first cut".G2 X20 Y-10 I10 J0is a clockwise arc to X 20, Y -10, with its centre 10 units right of the start.M104 S210(Marlin) sets the hotend to 210 degrees and does not wait for it.
Limits
- The time is an estimate. It uses a simple motion model with stock Shapeoko GRBL settings (XY 5000 mm/min, Z 1000 mm/min). Your machine will differ.
- The preview is a top view. It does not show tool size, so a pocket looks like its centre line.
- The page explains G-code. It does not check that a file is safe to run. Always do a dry run on the machine first.