G-code Viewer and Run Time Estimator
Paste or open G-code to see the toolpath, the size of the part, the cutting and rapid distances, and an estimated run time. Nothing leaves your browser.
The file is read in your browser only. Nothing is uploaded.
How it works
The page reads the program line by line, keeping track of the modal state the way a controller does: the current motion mode (G0 rapid, G1 line, G2 clockwise arc, G3 counter-clockwise arc), absolute or incremental positioning (G90, G91), millimeters or inches (G21, G20) and the feed rate F. Comments in brackets or after a semicolon are ignored.
time = cutting length ÷ feed + rapid length ÷ rapid speed + dwell
The time is an estimate of the ideal motion. Real machines slow down for corners and acceleration, so short segments (3D carving, small arcs) can take several times longer than the calculation. For milling feeds and spindle speeds use the Feeds and Speeds Calculator; the language itself is explained in G-code and Programming.
Worked example
The sample program cuts a 60 mm × 40 mm rounded rectangle with 10 mm corner radii, 1 mm deep. The straight sides total 130 mm and the four quarter circles total 2π × 10 = 62.83 mm, so the cutting at F600 is 19.3 s. The 6 mm plunge from Z5 down to Z-1 at F200 takes 1.8 s and the 11 mm of rapids at 5 000 mm/min take 0.1 s. The total is 21.2 seconds and the cutting distance is 198.83 mm.
Things to know
Only the XY plane is drawn (G17). Arcs in other planes (G18, G19), canned cycles (G81 to G89), cutter compensation and subprograms are not expanded: they are listed as skipped codes.
Controller dialects differ. Some machines use G2 and G3 with absolute I and J, or treat the first F as modal in a different way. Always prove a program with an air cut or a simulator before running it.
Check the first move and the Z moves: a program that starts with a rapid straight down at X and Y can crash the tool.
Laser and 3D printer files use the same G0, G1 and G2 or G3 but also extruder and power words; they are skipped, so time estimates for printers will be low.
Common questions
Is my file uploaded anywhere?
No. The page reads the file with your browser and does all the work locally.
Why is the real run longer than the estimate?
Machines accelerate and decelerate, slow at corners and cannot always reach the commanded feed on short moves. The estimate assumes the full programmed feed all the time.
What do I do with an arc given by R?
Use it normally: positive R is the shorter arc, negative R the longer one. A full circle cannot be written with R, so use I and J.
Sources
- NIST RS274NGC Interpreter, Version 3 (the reference for G-code syntax and modal groups).
- LinuxCNC G-code documentation, and Grbl and Marlin firmware references.
Last reviewed: November 2, 2026
