How to estimate filament and cost from an STL file
To estimate filament from an STL, take the model's volume, work out how much of it will actually be plastic (solid walls plus your infill share of the inside), and multiply by the filament's density to get grams. Divide grams by 1,000 and multiply by your spool price per kilogram for the cost. A slicer gives the most exact number after slicing; the estimate below is for before that, when you are quoting, comparing or sorting files.
The formula
Multiplying the whole volume by the infill percentage underestimates, because the outer walls and the top and bottom layers are printed solid whatever the infill. A better estimate splits the model into a shell and an interior:
- Shell volume = surface area × shell thickness, but never more than the total volume. A thickness of 0.8 mm corresponds to two 0.4 mm perimeters.
- Printed volume = shell + infill × (volume − shell).
- Weight (g) = printed volume in cm³ × density in g/cm³.
- Length (m) = printed volume in mm³ ÷ (π × (diameter ÷ 2)²) ÷ 1,000.
- Cost = weight in kg × price per kg.
You need two numbers from the STL: its volume and its surface area. Both are only meaningful if the units are right (STL files store no unit, so a file in inches read as millimeters is 16,387 times too small in volume) and if the mesh is closed. A mesh with holes has no well-defined inside.
Typical filament densities
These are common values. Brands and colors vary by a few percent, and the label or data sheet for your spool is the better source.
| Material | Density (g/cm³) | 1 m of 1.75 mm filament |
|---|---|---|
| PLA | 1.24 | about 3.0 g |
| PETG | 1.27 | about 3.1 g |
| ABS | 1.04 | about 2.5 g |
| TPU | 1.21 | about 2.9 g |
One meter of 1.75 mm filament is about 2.4 cm³ of plastic; 2.85 mm filament holds about 6.4 cm³ per meter.
A worked example
A solid 50 mm cube printed in PLA, 1.75 mm filament, 20% infill:
- Volume: 50 × 50 × 50 = 125,000 mm³ (125 cm³). Surface area: 6 × 50 × 50 = 15,000 mm².
- Shell: 15,000 × 0.8 = 12,000 mm³.
- Printed volume: 12,000 + 0.20 × (125,000 − 12,000) = 34,600 mm³ (34.6 cm³).
- Weight: 34.6 × 1.24 ≈ 42.9 g.
- Length: 34,600 ÷ 2.405 ÷ 1,000 ≈ 14.4 m.
- Cost at 20 per kilogram (in whatever currency you pay): 0.0429 × 20 ≈ 0.86.
The naive "volume × infill" method would give 125 × 0.20 × 1.24 = 31 g, about a quarter less, because it treats the walls as 20% full too.
Why your slicer gives a different number
Any estimate from the mesh alone is an approximation. The slicer knows things the STL does not:
- Wall count and layer settings. Three perimeters or thick top layers add plastic beyond a 0.8 mm shell.
- Infill pattern. At the same percentage, patterns differ slightly in how much they use.
- Supports, brims and rafts. These can add a lot on overhanging models and are not part of the model at all.
- Thin parts may be printed fully solid.
- Purge. Multi-material printers purge on every color change.
Use the estimate to compare and quote roughly; use the slicer's figure for the final price.
Doing it without the arithmetic
One STL, free, in the browser
Our free STL filament calculator takes a single STL and gives the size, volume and a filament estimate in the browser.
On a Mac, for STL and 3MF
STL Viewer for Mac uses exactly the formula above (0.8 mm shell, your infill, the densities in the table). Open an STL, 3MF, OBJ or PLY file and the inspector shows volume, surface area, and filament in grams and meters for PLA, PETG, ABS or TPU at 1.75 or 2.85 mm. Set the infill with a slider, enter what a kilogram of filament costs in your currency, and the cost of the part appears. 3MF files are measured in the unit they declare; for STL you can set the file unit if the size looks wrong.
The app also flags the cases where the estimate is unreliable: a mesh that is not watertight, faces pointing inward, or a model under 1 mm or over 2 m, which usually means a unit mix-up. File › Copy Print Report puts the size, volume, filament and cost on the clipboard as text for a quote or a print log.
Quoting a folder of files
In STL Viewer for Mac you can open several files at once, each in its own window or tab, and copy each print report. Batch Convert can also go through a folder and its subfolders and write summary.csv with the size, volume and watertight status of every model, to spot big parts and broken files before pricing. The app costs $19 once, with a 14-day trial; Batch Convert needs a license after the trial, while the inspector and print report keep working.
Before trusting any of these numbers, it is worth running through five checks for an STL before slicing.
Questions
How much filament does an STL use?
It depends on the model's volume and surface area, your infill and the material. As a rough guide, a solid 50 mm cube at 20% infill in PLA needs about 43 g, or about 14 m of 1.75 mm filament.
Can I just multiply the volume by the infill percentage?
That underestimates, because walls and top and bottom layers are solid. Add a shell (surface area × about 0.8 mm) and apply the infill only to what is left.
Why is the volume of my STL wrong?
Usually the unit (an inch file read as millimeters) or holes in the mesh. Volume is only meaningful for a closed, watertight mesh.
Does STL Viewer for Mac account for supports?
No. It estimates from the model alone, with a 0.8 mm shell and your infill. Supports, brims and your slicer's wall settings change the real number.