Change GIF Length
Trim, cut, or adjust GIF animation length and speed. Change frame timing, remove frames, and export optimized GIFs directly in your browser.
About
GIF animation length depends on two factors: the number of frames (N) and the per-frame delay (d), measured in hundredths of a second. Total duration equals N × d. Modifying either variable changes perceived length. This tool parses the raw GIF89a binary, extracts every Graphic Control Extension block, and lets you trim frame ranges or uniformly scale delay values. No server upload occurs. Processing runs entirely in your browser via a Web Worker performing LZW decompression and recompression.
Incorrect delay manipulation can produce GIFs that stutter or exceed platform file-size limits. Some frames carry local color tables or use disposal methods that, if stripped, cause visual artifacts. This tool preserves disposal flags and local palettes during re-encoding. Note: the GIF specification caps per-frame delay at 655.35 s. Extremely large files (>20 MB) or GIFs exceeding 1000 frames may cause memory pressure in constrained environments.
Formulas
The total duration of a GIF animation is computed from the sum of all individual frame delays:
Where T = total duration in hundredths of a second, N = total number of frames, di = delay of the i-th frame in hundredths of a second (stored as a 16-bit unsigned little-endian integer in the Graphic Control Extension block).
When changing speed by a factor s, each frame delay is scaled:
Where s > 1 speeds up (shorter delays), s < 1 slows down (longer delays). The minimum clamped delay is 2 (= 20 ms) because most browsers treat 0 or 1 as ~100 ms. Maximum is 65535 (655.35 s).
When trimming, the output contains frames from index a to b (inclusive), producing b − a + 1 frames. The new duration becomes:
Reference Data
| Platform | Max GIF Size | Max Duration | Max Dimensions | Recommended FPS | Notes |
|---|---|---|---|---|---|
| Twitter/X | 15 MB | 140 s | 1280×1080 px | 10 - 15 | Auto-converts to MP4 |
| Discord | 8 MB (free) / 50 MB (Nitro) | No limit | No limit | 15 - 25 | Avatar GIFs: 10 MB |
| Slack | 20 MB | No limit | No limit | 10 - 20 | Large GIFs preview poorly |
| 20 MB | 60 s | 1280×720 px | 10 - 15 | Converted to MP4 on upload | |
| Tumblr | 10 MB | No limit | 540 px wide | 10 - 15 | Resized if wider |
| GIPHY | 100 MB | 15 s recommended | 720 px wide | 15 - 24 | Optimized on ingest |
| 8 MB | No limit | No limit | 10 - 15 | Only via GIPHY integration | |
| iMessage | 5 MB | No limit | No limit | 10 - 15 | Larger GIFs sent as files |
| 16 MB | No limit | No limit | 10 - 15 | Auto-compressed | |
| 5 MB | No limit | No limit | 10 | GIFs in comments only | |
| Email (General) | 1 - 3 MB | <6 s | 600 px wide | 8 - 12 | Some clients block animation |
| GIF87a Spec | No limit | No limit | 65535×65535 px | N/A | No animation support |
| GIF89a Spec | No limit | Max delay: 655.35 s/frame | 65535×65535 px | Up to 100 | Supports transparency & animation |
| Photoshop Export | No limit | No limit | 30000×30000 px | 15 - 30 | Save for Web (Legacy) |