3D Print Cost Calculator › Guides

Where to find print time and filament weight in G-code and 3MF files

When a slicer exports a print, it writes its own estimate of the print time and the filament used into the file. You can read those numbers back without opening the slicer, which helps when you price an old job, check a file someone sent you, or batch-cost a folder of prints. Each slicer does it differently, though: different places, different units, and sometimes no weight at all.

Every example below is copied from a real, public file (listed under Sources). G-code is plain text, so you can open it in any text editor and search for the line.

PrusaSlicer, SuperSlicer and OrcaSlicer G-code

The totals are comments near the end of the file. This is from a PrusaSlicer 2.9 file:

; filament used [mm] = 4069.40
; filament used [cm3] = 9.79
; filament used [g] = 10.18
; total filament used [g] = 10.18
; estimated printing time (normal mode) = 1h 20m 43s

OrcaSlicer writes the same keys (it descends from PrusaSlicer) and also repeats the print time near the top of the file. With several extruders, each line holds one value per extruder, separated by commas.

Watch out: if the filament profile has no density set, the slicer writes filament used [g] = 0.00. Then multiply the [cm3] figure by your filament's density (see filament cost per gram).

Bambu Studio G-code

Bambu Studio puts its totals at the top of a plain G-code export, in a block between HEADER_BLOCK_START and HEADER_BLOCK_END. This is from a cube we sliced in Bambu Studio 02.08 for our test files:

; HEADER_BLOCK_START
; BambuStudio 02.08.02.61
; model printing time: 8m 46s; total estimated time: 8m 47s
; total layer number: 100
; total filament length [mm] : 1232.42
; total filament volume [cm^3] : 2964.32
; total filament weight [g] : 3.74

The calculator uses total estimated time (8 min 47 s here), the longer of the two times on that line. With several filaments, the length, volume and weight lines hold one value per filament, separated by commas.

Watch out: the volume line says cm³, but the number is in mm³. 1232.42 mm of 1.75 mm filament is 2964 mm³, which is 2.96 cm³. The weight line is the one to trust: 3.74 g is 2.96 cm³ at PLA's 1.26 g/cm³.

PrusaSlicer binary G-code (.bgcode)

Newer Prusa printers use binary G-code. It holds the same keys as above, but in compressed metadata blocks at the start of the file, so a text editor shows nothing useful. Open it in PrusaSlicer's G-code viewer, or drop it into the calculator, which reads those blocks in your browser.

Cura (Marlin and Klipper printers)

Cura puts its totals at the top, as print time in seconds and filament as a length in meters, with no weight:

;FLAVOR:Marlin
;TIME:870
;Filament used: 1.08208m

The ;TIME_ELAPSED: lines further down are progress markers for each layer, not the total. To get grams from the length, multiply by the filament's cross-section and density:

grams = length in cm × π × (diameter ÷ 2)² × density, with the diameter in cm (1.75 mm = 0.175 cm) and the density in g/cm³.

StepValue
Length1.08208 m = 108.208 cm
Volume (1.75 mm filament)2.603 cm³
Weight at 1.24 g/cm³3.23 g
Weight at 1.26 g/cm³3.28 g

PLA densities in slicer profiles run from about 1.22 to 1.32 g/cm³, so the grams depend a little on which you use. The calculator uses 1.24 for PLA when the file gives no weight and tells you the weight was estimated.

Cura for UltiMaker printers ("Griffin" flavor)

For UltiMaker printers, Cura writes a different header: time in seconds and filament as a volume in cubic millimeters, one line per extruder:

;FLAVOR:Griffin
;EXTRUDER_TRAIN.0.MATERIAL.VOLUME_USED:76525
;PRINT.TIME:92579

Divide the volume by 1,000 to get cm³, then multiply by the density: 76,525 mm³ is 76.525 cm³, which is 94.89 g at 1.24 g/cm³. The time, 92,579 seconds, is 25 h 42 min.

Bambu Studio and OrcaSlicer 3MF exports

A sliced 3MF (Bambu Studio's "Export plate sliced file", usually named .gcode.3mf) is a zip archive. Rename a copy to .zip to look inside. The totals are in Metadata/slice_info.config, one <plate> section per sliced plate:

<metadata key="prediction" value="843"/>
<metadata key="weight" value="3.69"/>
<filament id="1" type="PLA" used_m="1.22" used_g="3.69" ... />

prediction is the print time in seconds (843 s is 14 min 3 s) and used_g the grams for each filament. For a project with several plates, add the plates up: the calculator does this for you, as in the two-plate example in the filament guide.

A 3MF saved as a project before slicing has no prediction at all, and a plain model 3MF has no print data. Slice it and export the sliced file first.

Quick reference

FileTimeFilament
PrusaSlicer / OrcaSlicer G-codeend: h m send: mm, cm³, g
Bambu Studio G-codetop: h m stop: mm, g
PrusaSlicer .bgcodestart, binarystart, binary
Cura, Marlin flavortop: secondstop: meters
Cura, Griffin flavortop: secondstop: mm³
Bambu / Orca .gcode.3mfslice_info: secondsslice_info: m, g

These are the slicer's estimates. Real prints usually land close, but firmware acceleration settings and pauses can make the actual time differ.

Skip the digging. Drop any of these files into the free 3D print cost calculator. It reads the time and filament as described above, converts length or volume to grams when it has to (and says so), and prices the print. Your file never leaves your browser.

Sources

Lines checked against the files on 11 October 2026. Written by an AI agent (Claude).