Drop in a G-code file to step through it layer by layer in 3D. The panels beside the preview show estimated print time, filament length, weight, and cost, and flag a toolpath that is larger than your bed.
This tool runs entirely in your browser. What you enter is never sent anywhere.Your input is never sent anywhere.
DetailsDrop a G-code file here
or click to choose a file (.gcode, .gco, .g, .nc, .tap, .cnc, .txt)
What a G-code viewer shows before you start a print
A G-code viewer reads the text commands your slicer wrote and draws them as a toolpath you can rotate and step through layer by layer. This one also adds up the moves to estimate print time, filament length, weight, and cost, and compares the toolpath with your bed size.
Use it to answer three questions before you press print: how long will it take, how much filament does it need, and will it fit on my printer? It also opens CNC and laser G-code (.nc, .tap, .cnc), including files written in inches (G20).
The time is distance divided by feed rate, so it runs shorter than a real print. If the file has a time estimate written by the slicer (Cura or PrusaSlicer, for example), it is listed under Slicer info in file so you can compare the two.
When to check a G-code file before printing
Before a long print
Check Estimated time and Filament used, then compare the filament length with what is left on the spool. Enter your spool price under Price per kg to see the material cost.
Pre-sliced G-code from someone else
A file from a model site, a friend, or a print service was sliced for their printer. Check the axis ranges and the bed warning before you send it to yours.
Finding where a print went wrong
Drag the layer slider to the layer where a print failed, and check that the supports, infill, and bridges were sliced the way you expected.
Previewing a CNC or laser job
Open a .nc, .tap, or .cnc file to see the cutting moves in blue and the rapid moves in gray before you run the machine.
Load a file and read the print time, filament, and cost
- Drop a G-code file onto the upload area, or click it and choose a file (.gcode, .gco, .g, .nc, .tap, .cnc, .txt).
- Under Bed size / work area, pick your printer. If it is not listed, choose Custom size (mm) and enter X, Y, and Z. For a printer whose coordinates start at the bed center, set Origin (0, 0) to Bed center.
- In Filament settings, choose the Diameter, the Material, and the Price per kg.
- Drag the layer slider or press play to step through the layers. Use Isometric, Top, and Front to change the view, and Hide travel moves to see only the printed lines.
- Read Estimated time, Filament used, and Weight / cost under the preview, and check whether the bed warning appears.
Note: The file is read and drawn in your browser. It is not uploaded.
What the estimates leave out
- Print time is the length of each move divided by its feed rate (F). It ignores acceleration, heating, homing, and bed leveling, so a real print usually takes longer.
- Filament length comes from increases in the E value. A retraction followed by an unretraction is not counted twice. If your slicer writes volumetric E values (mm³), the length and weight will be wrong, so turn that option off before slicing.
- Arcs (G2, G3) are drawn and measured as straight lines between their end points.
- Layers are read from ;LAYER: comments (Cura). Without them, a new layer starts when an extruding move is more than 0.05 mm above the last layer, so layers thinner than that merge.
- For 3D printer files, the size and the bed check use extruding moves only. Travel moves are ignored, but a purge line printed outside the bed edge still counts.
- G20 (inches) and G21 (millimeters) are both read. Line numbers (N10) and comments in parentheses are accepted.
- In CNC and laser files, G0 is drawn as a rapid move and the slider moves through up to 200 equal steps instead of layers. The time uses the last F value for every move, so treat it as rough.
- Large files (tens of MB) can take a while to parse and draw.
Grams per meter of filament by material
Weight comes from filament length, diameter, and density. These are the Material presets used in Filament settings.
| Material | Density (g/cm³) | 1.75 mm filament (g per m) | 2.85 mm filament (g per m) |
|---|---|---|---|
| PLA | 1.24 | 2.98 | 7.91 |
| PETG | 1.27 | 3.05 | 8.10 |
| ABS | 1.04 | 2.50 | 6.63 |
| ASA | 1.07 | 2.57 | 6.83 |
| TPU | 1.21 | 2.91 | 7.72 |
| Nylon | 1.14 | 2.74 | 7.27 |
One meter is 3.28 ft; multiply a value by 0.3048 for grams per foot. A 1 kg spool of 1.75 mm PLA holds about 335 m (1,100 ft) of filament. If your brand publishes a density, choose Custom density in the Material menu and enter it.
How the print time, filament, and cost numbers are calculated
Each number is a plain calculation on the moves in the file. This is what goes into each one.
Why the estimate differs from your slicer's time
Estimated time adds up distance ÷ feed rate for every move. A printer also slows for corners, accelerates at the start of each line, and spends time heating the nozzle and bed. Prints with many short segments or sharp turns run furthest over the estimate. When the file carries the slicer's own time, it appears under Slicer info in file.
How filament length becomes grams and dollars
The tool adds up every increase in the E value, converts that length to volume with the diameter you pick (π × radius² × length), and multiplies by the material density. Cost = weight ÷ 1,000 × Price per kg. The price starts at $20 per kg. Retractions are tracked so the same millimeters are not counted again when the filament is pushed back.
What G0, G1, G2, G3, and E mean
G0 and G1 move the tool, G2 and G3 move along an arc, and E sets how much filament is pushed. A move with a rising E is drawn as extrusion, and a move without it is a travel move. Hide travel moves leaves only what gets printed.
How layers are detected for the layer slider
Cura writes ;LAYER: comments, and the tool uses them directly. Other slicers do not, so a new layer starts when an extruding move is more than 0.05 mm above the last one. Z hops during travel moves do not create layers.
3D printer G-code vs. CNC and laser G-code
A file with no E values is treated as CNC or laser G-code. Blue lines are cutting moves (G1, G2, G3), gray lines are rapid moves (G0), the filament settings are hidden, and the slider steps through the path instead of layers.
Fixing a wrong bed warning, time, or filament number
The bed warning appears but the model fits
The message lists which edge the toolpath crosses and by how much. A purge or intro line printed just outside the bed (for example at Y = -3 mm) triggers it even when the model is inside. Delta printers and some custom machine profiles also put (0, 0) at the center of the bed.
💡 See the solution▼
The estimated time is much shorter than the real print
The tool counts movement at the programmed feed rate only. Heating, homing, acceleration, and slow first layers are not included.
💡 See the solution▼
The filament weight is far from what the slicer says
The weight uses the diameter and density you picked. Choosing 2.85 mm for 1.75 mm filament gives about 2.65 times the weight. A slicer set to volumetric E values also throws off the length.
💡 See the solution▼
The layer count does not match the slicer
Without ;LAYER: comments, layers are found from the Z height of extruding moves. Layers closer together than 0.05 mm merge into one, and vase-mode prints with a rising Z can split into many small layers.
💡 See the solution▼
The Send this G-code button does not appear
The button shows up only after you click Connect, and only in Chrome or Edge on a desktop computer. Other browsers show a message that Web Serial is not supported.
💡 See the solution▼
Questions about G-code time, filament, and file support
Q.How do I open a G-code file without a slicer?
A. Drop the file onto the upload area, or click the area and choose the file. The tool reads .gcode, .gco, .g, .nc, .tap, .cnc, and .txt files. Packaged formats such as .3mf and binary G-code (.bgcode) are not read, so export plain G-code from your slicer instead.
Q.How accurate is the print time estimate?
A. It is a rough minimum. The time is the length of each move divided by its feed rate, added up for the whole file. It leaves out acceleration, heating, homing, and bed leveling, so a real print usually runs longer. If the file includes the slicer's own estimate, it is shown under Slicer info in file.
Q.How much filament does a G-code file use?
A. The Filament used card shows the length in meters and feet, taken from the E values in the file. Weight / cost converts that length to grams using the Diameter and Material you choose. For 1.75 mm PLA, 1 m weighs about 3 g.
Q.How is the cost of a print calculated from G-code?
A. Cost is the weight in grams divided by 1,000, times the Price per kg you enter. The price starts at $20 per kg. The cost covers only the filament counted in the file. It does not include failed prints, electricity, or filament lost when you change spools.
Q.How do I check whether a G-code file fits my bed?
A. Pick your printer under Bed size / work area, or choose Custom size (mm) and enter X, Y, and Z. If the toolpath crosses a bed edge or the build height, a red warning lists the edge and how many millimeters it goes past. Sizes are shown in mm and inches.
Q.Why does it say the toolpath exceeds the bed when my model fits?
A. The usual cause is a purge line printed just outside the bed edge, because extruding moves count toward the size check. The other cause is the Origin (0, 0) setting. For printers whose coordinates start at the center of the bed, switch from Front-left corner to Bed center.
Q.How do I hide travel moves in a G-code preview?
A. Click Hide travel moves above the preview. The gray non-printing moves disappear and only the extruding moves remain. In CNC and laser files, the same button hides rapid (G0) moves.
Q.Can I view CNC or laser G-code, including files in inches?
A. Yes. A file with no E values opens in CNC / laser mode. Both G20 (inches) and G21 (millimeters) are read, and sizes are shown in mm and inches. CNC files have no layers, so the slider steps through the path in up to 200 equal steps.
Q.Is my G-code file uploaded anywhere?
A. No. The file is read and drawn in your browser, and it is not sent to a server. If you use Web Serial, the data goes from your browser straight to the device on your USB port.
Q.Can I send G-code to my printer from the browser?
A. In Chrome or Edge on a desktop computer, open Send over USB (Web Serial, experimental), pick the baud rate, click Connect, then click Send this G-code. It writes every line without waiting for the printer to reply, so the printer's buffer can overflow. For real prints, use an SD card, a USB drive, or your printer's network upload.
Your feedback
makes this tool better.
Tell us which features you'd like, what should be fixed, or which new tool you'd like to see. An engineer reads every submission and uses it to guide development.