induwara.lk
induwara.lkImage · Privacy-first

Video to GIF Converter — turn a clip into an animated GIF

Convert MP4, WebM, or MOV clips into a single animated .gif file in your browser. Pick the start time, duration, frame rate, and output size — the file never leaves your device, no signup, sources cited below.

By Induwara AshinsanaUpdated May 11, 2026
Video to GIFMP4 / WebM / MOV → animated GIF · in-browser
Files stay on your device

Everything runs in your browser. Nothing is uploaded.

What this does

Pick a short MP4, WebM, or MOV clip and the tool turns the slice you choose into an animated .gif file. Set the start time, duration, fps, and output size — files never leave your tab. The browser's native video decoder handles every supported codec, so there's no 30 MB ffmpeg.wasm download.

Estimator uses an empirical bytes-per-pixel band fitted against gifenc output on flat / midtone / photo content. Actual file size is set by the LZW encoder and may differ ±15% on textured frames. Sources last verified 2026-05-11.

How it works

A video container (MP4, WebM, MOV) is a wrapper around a stream of compressed frames. Modern codecs — H.264, VP9, AV1 — encode each frame as a delta from previous ones, which is why a 30-second 1080p clip can fit in a few megabytes. A GIF, by contrast, stores every frame in full as an LZW-compressed palette-indexed bitmap, with no memory of what came before. Converting one to the other is mostly an exercise in deciding what to throw away: which slice of time, which size, which frame rate, which 256 colours per frame.

This tool runs that pipeline entirely in your browser, in five deterministic steps per frame:

  1. Probe. The video is loaded into a hidden <video> element so the browser reports its dimensions, duration, and decodable codec. No JavaScript demuxer is involved — every modern browser ships native MP4 / WebM / MOV decoders.
  2. Seek. For each output frame the tool sets video.currentTime to a precise timestamp and waits for the seeked event (or requestVideoFrameCallback where available, which fires after the frame is actually painted and avoids a single-frame Safari lag).
  3. Cover-fit. The decoded frame is drawn onto a canvas sized to your chosen longest-side cap. The cover-fit scales uniformly to fill and centre-crops the overflow — landscape sources cropped on the sides, portrait sources cropped top and bottom. This keeps the GIF rectangle consistent across frames.
  4. Quantise & index. The canvas's 24-bit RGBA pixels are reduced to a palette of up to 256 colours using PnnQuant — a port of Mark McNeill's Pairwise Nearest Neighbour algorithm. Each pixel is then re-mapped to its nearest palette entry, producing a flat Uint8Array with one byte per pixel.
  5. Compress & write. LZW compresses the indexed bitmap; the encoder writes a Graphic Control Extension (delay + transparent index) and an Image Descriptor; on the first frame it also writes the GIF89a header, the Logical Screen Descriptor, the Global Colour Table, and the Netscape 2.0 application extension (loop count). The final byte string is wrapped in a Blob and offered as a download.

Frame count and file size follow two simple formulas:

frames           = round(duration_s × fps)   (clamped to 200)
delay_ms         = round(1000 / fps)
bytes_per_frame  = pixels × density + 18 (GCE + ImgDesc)
  density(flat)    = 0.40
  density(midtone) = 0.55
  density(photo)   = 0.70
header           = 14 + 19 (Netscape) + 3 × paletteSize
total_bytes      = header + frames × bytes_per_frame

The estimator is cross-checked two ways — once with a continuous density curve, once with a discrete content-band lookup — and the two land within ±5% on every input in the valid range. Real output may differ ±15% on textured frames, because LZW's reward for finding long runs of repeated colour depends on the actual pixel values, not just the content category. The figure shown on the calculator is a best estimate, not a measurement.

Worked examples

3-second phone clip at 480 × 270, 10 fps

Three seconds of footage from a phone, resized to 480 × 270 and sampled at 10 fps (30 frames). Photographic content quantises to about 0.55 bytes per pixel after LZW, so the GIF lands near 2 MB — fits in a Slack or WhatsApp message without compression.

  1. Duration: 3 s · 10 fps → 30 frames
  2. Cross-check (via delay): 30 frames · Δ match
  3. Pixels / frame: 480 × 270 = 129,600
  4. Palette: 256 colours · delay 100 ms
  5. Estimate (curve): ≈ 2.0 MB
  6. Cross-check (lookup): ≈ 2.0 MB

1-second meme reaction at 320 × 180, 12 fps

One-second reaction clip downscaled to 320 × 180 and sampled at 12 fps (12 frames), palette trimmed to 128 colours. Small enough to drop into a forum reply or Discord message — about 370 KB.

  1. Duration: 1 s · 12 fps → 12 frames
  2. Cross-check (via delay): 12 frames · Δ match
  3. Pixels / frame: 320 × 180 = 57,600
  4. Palette: 128 colours · delay 83 ms
  5. Estimate (curve): ≈ 371.9 KB
  6. Cross-check (lookup): ≈ 371.9 KB

5-second cartoon loop at 240 × 240, 8 fps

Five seconds of flat-colour animation, square crop at 240 × 240, sampled at 8 fps (40 frames). Cartoons LZW-compress close to 0.4 bytes per pixel — the GIF lands near 900 KB despite being five times longer than the meme example.

  1. Duration: 5 s · 8 fps → 40 frames
  2. Cross-check (via delay): 40 frames · Δ match
  3. Pixels / frame: 240 × 240 = 57,600
  4. Palette: 64 colours · delay 125 ms
  5. Estimate (curve): ≈ 900.9 KB
  6. Cross-check (lookup): ≈ 900.9 KB

Frame rate, delay, and the GIF clock

GIF delays are stored as hundredths of a second — a 16-bit unsigned integer in the GIF89a Graphic Control Extension. The tool exposes frame rate in fps because that's the unit video tools speak, but the encoder writes the equivalent delay underneath. The table below shows the conversion for the rates the FPS presets cover.

Frame rateDelay5-sec clip = framesBest for
5 fps200 ms25Slideshow, step-by-step instructions
8 fps125 ms40Slow animation, screen recordings
10 fps100 ms50Reaction GIFs, memes (the default)
12 fps83 ms60Hand-drawn animation rate
15 fps67 ms75Web-smooth animation
24 fps42 ms120Film rate; halve the duration to stay under cap

Most browsers floor the effective per-frame delay at 20 ms and quietly bump 0–10 ms delays to 100 ms for compatibility with old GIF89a players. The tool clamps the output frame count to 200 regardless of fps × duration — beyond that, the file size crosses 30 MB on typical content and most chat clients refuse to inline-play.

Frequently asked questions

Sources & references

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.