Staaarter

GIF Duration Changer

Scales every frame's delay proportionally so the GIF's whole animation plays for exactly a target duration, in seconds - the same proportional-scaling idea as the playback speed changer, driven by an absolute time target instead of a multiplier. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-29
By Staaarter Team
timingconversionanimation

Overview

Introduction

Sometimes what you know isn't a speed multiplier but an exact time budget: "this GIF needs to play in exactly 3 seconds to fit a slide," for example. This tool takes that target directly.

It uses the same proportional retiming approach as GIF Playback Speed Changer, just driven from the opposite direction - by a destination duration rather than a starting multiplier.

What Is GIF Duration Changer?

GIF Duration Changer takes a target TOTAL duration, in seconds, and proportionally scales every frame's delay so the GIF's entire playback time matches that target as closely as GIF's whole-centisecond delay resolution allows.

Like GIF Playback Speed Changer, it preserves each frame's timing relative to the others (a frame that was originally twice as long as its neighbor stays twice as long). The difference is purely what you input: a multiplier there, an absolute number of seconds here. It's also entirely separate from GIF Length Changer, which adjusts the FRAME COUNT rather than any timing value.

How GIF Duration Changer Works

The tool decodes the GIF, sums all original frame delays to get the current total duration, and divides the target duration (converted to centiseconds) by that total to get a single scale factor.

That scale factor is applied to every frame's own delay individually, each rounded to the nearest whole centisecond and clamped to GIF's valid range, then all frames are re-encoded. The tool reports the real total duration achieved after rounding, since it can differ very slightly from the exact target.

When To Use GIF Duration Changer

Use it when you have a specific time budget the GIF needs to fit, such as a fixed-length slide, a looping banner ad slot, or matching another asset's exact runtime.

Use GIF Playback Speed Changer instead if you're thinking in terms of "how much faster/slower," not an absolute number of seconds.

Features

Advantages

  • Lets you target an exact total playback time directly, without manually computing a speed multiplier.
  • Preserves each frame's timing relative to the others rather than flattening all delays to one value.
  • Reports the real achieved duration, so any small rounding drift is visible rather than silent.

Limitations

  • Whole-centisecond delay rounding means the exact target duration usually can't be hit to the millisecond, especially on GIFs with many frames.
  • A GIF with only one or two frames has very little granularity to distribute a target duration across, which can produce a less smooth result than a many-frame source.

Examples

Retiming to exactly 2 seconds

Input

Target: 2.0s (200cs); original total: 100cs across 5 frames of 20cs each

Output

New delays: 40cs each (new total: 200cs)

The scale factor is 200cs / 100cs = 2, so every 20cs frame becomes 40cs, hitting the 2-second target exactly since it divides evenly.

Best Practices & Notes

Best Practices

  • Check the reported applied duration after converting, especially for targets that don't divide evenly across the frame count.
  • If you need both a specific duration AND a specific frame count, use GIF Length Changer first to set the frame count, then this tool to hit the duration.
  • Normalize inconsistent frame timing with GIF Speed Normalizer first if you want the pre-scaling delays to already be even.

Developer Notes

`scale = targetTotalCs / originalTotalCs`, then `newDelay_i = round(originalDelay_i * scale)` per frame, clamped to GIF's 1-10000cs delay bounds. Because each frame rounds independently, the sum of rounded delays can drift by roughly +/- 0.5cs per frame from the exact target - negligible for most uses but worth checking on very short targets.

GIF Duration Changer Use Cases

  • Fitting a GIF's playback exactly into a fixed-duration slide or ad slot
  • Matching a GIF's runtime to an accompanying audio clip or video segment
  • Standardizing a batch of GIFs from different sources to the same total playback time

Common Mistakes

  • Assuming the target duration is achieved to the exact millisecond - GIF's centisecond delay resolution introduces small, usually negligible rounding drift.
  • Using this tool when a relative speed change (twice as fast, half as slow) is really what's wanted - GIF Playback Speed Changer is more direct for that.

Tips

  • Very short target durations on a many-frame GIF can push individual frame delays down to GIF's 1cs minimum, which may look choppier than expected.
  • Pair with GIF Speed Normalizer beforehand if the source GIF's timing is already inconsistent in a way you don't want carried through the scaling.

References

Frequently Asked Questions