Retraction Settings Calculator

Typical starting retraction is 0.5 to 2 mm at 25 to 45 mm/s on a direct drive and 3 to 7 mm at 35 to 60 mm/s on a Bowden. Enter your setup for a starting point, then plan a test tower to find your printer's own best value. Published October 30, 2026.

Your setup

Test tower plan

Read your tower

Segment 1 is the bottom one. Pick the lowest setting with no strings or only fine wisps that brush off.

Suggested Starting Settings

    Test Tower Plan

    SegmentHeight fromtoValue

    1. Add firmware retraction to printer.cfg and RESTART. In the slicer turn on Use firmware retraction so it sends G10 / G11. Klipper's firmware retraction does not lift Z, so set z-hop in the slicer if you need it.

    printer.cfg
    -

    2. Start the tower print and send this from the console just after the start G-code (or as the last line of the start G-code). It sets the value from the height of each move:

    Console
    -

    Klipper works out value = START + STEP_DELTA × floor((Z − SKIP) ÷ STEP_HEIGHT), which matches the table. SET_RETRACTION changes are lost at RESTART, so put the winning value in [firmware_retraction] (or in your slicer if you go back to slicer retraction).

    Marlin's M207 only works when the firmware was built with FWRETRACT (many stock printer firmwares were not; send M207 alone and see if it answers). In the slicer turn on Use firmware retraction so it sends G10 / G11.

    Start G-code (after homing)
    -

    Then add one line at the start height of each segment, with the slicer's "custom G-code at height" (below):

    Per-segment lines
    -

    M207 F and M208 F are in mm/min (mm/s × 60). Save the winner with M500 if EEPROM is enabled.

    • OrcaSlicer: Calibration menu → Retraction test builds a tower for you; it raises the length by a set amount per mm of height, so read your best height into "Read your tower" with matching start, step and height.
    • PrusaSlicer: slice the tower, drag the layer slider to each segment start height in the table, click the orange plus and choose Add custom G-code, then paste that segment's line.
    • Cura: Extensions → Post Processing → Modify G-Code → Insert at layer change or ChangeAtZ at each height.
    • Without firmware retraction (slicer retraction left on): print one model per setting instead, side by side as separate objects with their own retraction override, or one tower per setting. Retraction is a printer/extruder setting, so height-range modifiers cannot change it mid-print.
    Height and line for each segment (Klipper)
    -

    How the Retraction Calculator Works

    Retraction pulls the filament back a little before each travel move so the nozzle stops oozing, then pushes it forward again before printing restarts. The right distance mostly depends on how much slack there is between the extruder gears and the nozzle: very little on a direct drive, a lot in a long Bowden tube.

    The calculator gives typical starting ranges, then plans a test tower so you can find your printer's own value. The starting ranges are rules of thumb gathered from common slicer profiles and printer makers' defaults, not exact figures.

    The Method

    1. Starting range (rule of thumb)
    direct drive: 0.5–2 mm, start 0.8 mm, 25–45 mm/s
    Bowden: low = L/160 + 0.5, start = L/100 + 1, high = L/80 + 2 (mm)
    Bowden speed: 35–60 mm/s, start 45
    L is the tube length in mm, and Bowden values are kept between 2 and 8 mm. A 400 mm tube gives 3 to 7 mm with 5 mm to start, the common default on Ender-3-class printers.
    2. Material and hotend
    PETG: distance × 1.1 and speed × 0.8. Nylon, PC and filled filaments: speed × 0.9. TPU: 0 to 1 mm at 10 to 25 mm/s on a direct drive. All-metal hotend on a direct drive: capped at 1.5 mm to avoid heat-break jams. PTFE-lined hotends get a warning for materials that need more than about 240 °C.
    3. Test tower plan
    segment i: from base + (i − 1) × h to base + i × h
    value i = start + (i − 1) × step
    This is the same sum Klipper's TUNING_TOWER uses with STEP_DELTA, STEP_HEIGHT and SKIP, so the table, the console command and the slicer heights all agree.
    4. Reading the tower
    segment = floor((height − base) ÷ h) + 1
    Measure up to the cleanest part with calipers, or count segments from the bottom. Choose the lowest value that gives clean travel: more retraction than needed only adds wear and the risk of jams.

    Worked Example

    Ender-3-class Bowden, 400 mm tube, PTFE-lined hotend, PLA, 0.4 mm nozzle
    • Starting range: 400/160 + 0.5 = 3.0 mm to 400/80 + 2 = 7.0 mm, start at 400/100 + 1 = 5.0 mm, at 35 to 60 mm/s (start 45).
    • Tower: start 3 mm, step 0.5 mm, 9 segments of 5 mm on a 1 mm base, so 3.0 mm from 1 to 6 mm high, 3.5 mm from 6 to 11 mm, and so on up to 7.0 mm from 41 to 46 mm.
    • Klipper: TUNING_TOWER COMMAND=SET_RETRACTION PARAMETER=RETRACT_LENGTH START=3 STEP_DELTA=0.5 STEP_HEIGHT=5 SKIP=1.
    • Marlin with FWRETRACT: M207 S3 F2700 Z0 in the start G-code, then M207 S3.5 at 6 mm, M207 S4 at 11 mm and so on.
    • The strings stop at 18 mm high: floor((18 − 1) ÷ 5) + 1 = segment 4, which is 4.5 mm. Set 4.5 mm as the retraction length; if it is borderline, try the next one up.

    Stringing Troubleshooting

    Likely causeWhat to try

    Drying temperatures are typical; follow your filament maker's figures.

    Practical Tips

    • Fix e-steps and temperature first. An extruder that pushes the wrong amount makes every retraction test misleading. Calibrate it with the steps per mm calculator.
    • Tune pressure / linear advance, then retraction. Advance lowers the pressure in the nozzle at the end of each line, so you often need less retraction afterwards. See the linear advance calculator.
    • Change one thing at a time. Test distance at a fixed speed, then speed at the chosen distance.
    • Too much is worse than a few wisps. Over-long retraction causes gaps after travel, clicking extruders, ground filament and heat-break jams. A quick pass with a heat gun removes fine wisps.
    • Printing fixtures or brackets? Size the holes with the hole compensation tool, heat-set insert hole sizes and the clearance hole chart.

    More 3D Printing Tools

    Frequently Asked Questions

    A typical starting point is 0.5 to 2 mm at 25 to 45 mm/s, often about 0.8 mm at 35 mm/s for PLA. Print a test tower from 0.2 mm in 0.2 mm steps and choose the lowest value with clean travel. More than about 2 mm on a direct drive is rarely needed.

    Typically 3 to 7 mm at 35 to 60 mm/s, longer for longer tubes. Ender-3-class printers with about 400 mm of tube commonly start at 5 mm and 45 mm/s. Test from about 3 mm in 0.5 mm steps.

    Add a [firmware_retraction] section, restart, and set the slicer to use firmware retraction (G10/G11). Start printing the tower and send TUNING_TOWER COMMAND=SET_RETRACTION PARAMETER=RETRACT_LENGTH START=0.2 STEP_DELTA=0.2 STEP_HEIGHT=5 with your own values. Klipper then changes the length every 5 mm of height.

    PETG strings mainly from moisture and heat, so longer retraction rarely cures it. Dry the filament, lower the nozzle temperature 5 to 10 °C, raise travel speed, turn on wipe and keep z-hop off or small. Go back to a normal retraction length once the cause is fixed.

    Use very little or none. Flexible filament squashes instead of pulling back, and long retractions can buckle it in the extruder. On a direct drive try 0 to 1 mm at 10 to 25 mm/s, print slowly and lower the temperature to control strings.

    Starting ranges are typical values and rules of thumb, not data for your printer. Always confirm with a test print, check the commands against your firmware version, and keep a copy of your old settings.