MeshMath

Temperature tower G-code generator

Slice any temperature tower model normally, then load the G-code here to add a temperature change at every section.

Nothing is uploaded; the file is edited on your device.

Plan

SectionStarts at ZTemperature

How it works

The tool reads every move line with a Z value (G0/G1 … Z). When the nozzle reaches a new section it inserts M104 S<temp> just before that move, so the temperature changes at the right layer:

section = floor((Z − first Z) ÷ section height)
temperature = start + section × change

Use M104 (set and continue) for towers — the hotend adjusts within a few seconds. M109 waits for the temperature but can leave blobs. The model's sections must match your section height; most popular towers use 10 mm sections with a ~1 mm base.

Suggested ranges

MaterialStart → end
PLA220 → 190 °C
PETG250 → 220 °C
ABS / ASA260 → 230 °C
TPU235 → 210 °C

Pick the coolest section with good layer bonding and bridges — usually 5–10 °C above where stringing stops being the main problem. Then check your filament is dry if stringing persists everywhere.

Worked example

Worked example

A PETG tower, 7 sections, 10 mm each

Start temperature230 °C at Z = 0.2 mm
Change−5 °C every 10 mm
Section at Z = 10.2 mmfloor(10 ÷ 10) = 1 → 225 °C
Final section230 − 6 × 5 = 200 °C
Total height70 mm

Order the sections hottest at the bottom, so the first layers bond well and the cooler, more stringy end is easy to judge at the top.

Typical ranges to test

MaterialTower rangeTypical sweet spot
PLA220 → 190 °C200–215 °C
PETG250 → 220 °C230–245 °C
ABS / ASA260 → 230 °C240–255 °C
TPU 95A235 → 205 °C215–230 °C
Silk PLA230 → 200 °C210–225 °C

Ranges consistent with manufacturer print-temperature guidance; your filament’s label and TDS take precedence.

How to read the tower

Go section by section: look for stringing between pillars (too hot), rough or droopy overhangs and bridges (too hot or not enough cooling), and gaps or weak layers that snap when you flex the tower (too cold). The best temperature is usually the coolest one that still bonds well, and you can snap a section with pliers to compare strength.

Common mistakes

Troubleshooting

SymptomLikely causeFix
Temperature never changesSlicer start G-code overrides, or file uses relative ZCheck the generated file contains M104 lines at the right Z
Changes happen at wrong heightsFirst-layer height differsSet First layer Z to match your slicer
Blobs or a seam at each changeNozzle still settling to the new temperatureNormal; the tool inserts non-blocking M104, so the first few millimetres of each section are in transition

How to use the generator

  1. Download or design a temperature tower model with equal sections (10 mm is common).
  2. Slice it at a single temperature with your normal settings and save the G-code.
  3. Load the G-code here, set start temperature, change per section, section height and first layer Z.
  4. Download the modified file, check the preview list of changes, and print while watching the first change.

FAQ

How do I make a temperature tower?

Download any temperature tower STL, slice it at a single temperature, then load the G-code here, set the start temperature, change per section and section height, and download the modified file.

Does this work with Bambu Studio, PrusaSlicer, Cura and OrcaSlicer?

Yes — it edits plain G-code, so it works with any slicer that outputs standard G0/G1 moves. For Bambu .3mf print files, export plain G-code first.

Should temperatures go up or down the tower?

Start hot at the bottom and go cooler, because the bottom is printed first and hotter layers stick best to the bed.

Can I use this for a retraction test?

This version changes temperature. For retraction, change one retraction setting per print or use your slicer's built-in calibration.

Recommended gear

Some links are affiliate links. MeshMath earns a commission on purchases made through Overture and Anycubic (via Awin) links, at no extra cost to you. Picks are chosen for usefulness, not paid placement.

Related tools

See all tools →