MP4 to GIF

Published Updated

Turn an MP4 into a looping GIF at 5, 10 or 15 frames per second and 320, 480 or 640 pixels wide, up to 450 frames.

A worked example: a 12-second screen recording

A GIF made here holds at most 450 frames, counted from the first frame of the video, so 10 fps covers 45 seconds and 15 fps covers 30. Take a 1920 x 1080 MP4 that lasts 12 seconds. At 10 fps and 480 px wide the tool reads 120 frames, each resized to 480 x 270 (129,600 pixels). In total that is about 15.6 million palette indices before compression. Move to 15 fps and you get 180 frames and 23.3 million. Move to 320 px and each frame drops to 320 x 180, 57,600 pixels.

Frames come from seeking the video to each timestamp, not from playing it, so conversion is not tied to real time. It takes as long as your browser needs to seek to each of those frames. Timestamps start at 0:00 and step by 1 / fps. The page offers no start or end field.

Settings and the 16:9 result

For a 16:9 source, the width option decides the size of every frame.

WidthFrame sizePixels per frameFrames in a 12 s clip at 10 fps
320 px320 x 18057,600120
480 px480 x 270129,600120
640 px640 x 360230,400120

The frame count does not change with the width. Only the pixels per frame do. In our test both settings moved the file size by a similar factor (see the measured table below), while only the frame rate changes how smooth the motion looks.

Nine settings on one test file, four engines

To go with the worked example above, we ran the page's own steps (seek to each timestamp, draw the frame, then the site's GIF encoder) in Google Chrome 156, Chromium 153 (Playwright build, not Google Chrome), Firefox 155 and Playwright's WebKit build (not the Safari app). The input was a generated MP4 that the browsers read as 4.14 seconds long: 640 x 360, H.264, 634,269 bytes, a smooth animation with a gradient, a moving disc and a progress bar. Sizes are in bytes, one run per cell.

SettingFrames, sizeChrome 156Chromium 153Firefox 155WebKit build
5 fps, 320 px21, 320 x 180131,318129,903131,416129,139
5 fps, 480 px21, 480 x 270225,606219,807217,138215,876
5 fps, 640 px21, 640 x 360338,357325,029332,623332,916
10 fps, 320 px (default)42, 320 x 180258,363259,810263,529259,270
10 fps, 480 px42, 480 x 270467,859441,163445,159440,749
10 fps, 640 px42, 640 x 360677,392666,795686,250664,793
15 fps, 320 px63, 320 x 180389,309387,093394,050380,908
15 fps, 480 px63, 480 x 270675,028667,129652,738674,538
15 fps, 640 px63, 640 x 3601,065,1791,021,3091,030,8321,051,661

The engines differed by at most 6.2 percent at any setting, because each browser decodes and scales the video a little differently before the encoder sees it. In Chrome 156, going from 320 to 640 px multiplied the size by 2.58 to 2.74, and going from 5 to 15 fps by 2.96 to 3.15. The smallest GIF was about a fifth of the MP4's size and the largest 1.68 times it.

A whole run took 0.9 to 3.0 seconds in Chrome 156, 0.6 to 1.8 in Chromium 153, 0.7 to 2.8 in Firefox 155 and 0.8 to 4.4 in the WebKit build. Most of that is seeking; the GIF encoding itself took 108 to 610 ms.

Colors, timing and the last frame, measured

  • Every GIF had a 256-entry palette and the looping header. 224 to 247 of the 256 colors were in use, while one frame of the source held 1,613 to 6,326 different colors. Against the frames before reduction, the average error was 3.25 to 3.81 per channel on a 0 to 255 scale, and at most 0.22 percent of pixels were off by more than 24 in any channel.
  • Frames came from where the page asks for them. Reading the progress bar in each frame, the picture was within 0.048 seconds of the requested time for every frame before the end.
  • The end repeats. This MP4 reports 4.14 seconds, but its last picture comes at about 3.96 to 3.97 seconds. The page still asks for frames up to 4.13 seconds, so the last picture appeared once more at 10 fps and twice more at 15 fps, in all four engines.
  • Delays read back as 200, 100 and 70 ms, so the 63 frames at 15 fps play for 4.41 seconds, as the FAQ below explains.
  • An MP4 written by Chromium's own recorder (fragmented, 633,699 bytes) gave 41 or 42 frames at 10 fps in three engines. Firefox 155 read its length as 0.134 seconds, so the GIF had 2 frames and 23,445 bytes, and nothing warned about it.
  • A file of random bytes named .mp4 got the page's message that this browser can't read this video file, in all four engines.

Making a GIF from an MP4

  1. Step 1

    Choose an MP4

    Pick one MP4 file. The Convert button turns on once the length and dimensions show below the preview.

  2. Step 2

    Set frame rate and width

    Pick the frame rate from 5, 10 or 15, and the width from 320, 480 or 640 px. Height follows the video's shape.

  3. Step 3

    Convert, check, download

    The result card lists frames, size in pixels and file size. Download it, or go back and try other settings.

How the colors are chosen

A GIF can hold 256 colors, and this encoder builds one for the whole animation.

  • The palette comes from about 20,000 pixels sampled across all frames, using median cut.
  • Each pixel is matched after its red, green and blue values are reduced to 5 bits each, and there is no .
  • A clip that moves from a bright scene to a dark one shares the same palette, so one of the two can look worse. Gradients and skies can show visible bands.

Frame delays in hundredths of a second and the 256-color limit both come from the GIF89a specification.

Keep the MP4 when

A GIF has no sound, and it can be bigger than the MP4 it came from: on the 4-second test file above, the 10 fps GIFs at 640 px and the 15 fps GIFs at 480 or 640 px were 1.03 to 1.68 times the 634,269-byte MP4 in all four engines. Use the GIF where a place takes images but not video. If the result is too heavy, try GIF Compressor, or go the other way with GIF to MP4.

MP4 to GIF questions

Can I convert a WebM or MOV file here?

The file picker on this page only offers MP4. For a QuickTime file use MOV to GIF, and for WebM or other formats use Video to GIF. They share the same engine and the same frame cap.

What happens when my clip is longer than the frame limit?

The GIF stops at 450 frames, counted from the start of the video. At 10 fps that is the first 45 seconds, and the rest is left out rather than sped up. Cut the clip first with Trim Video if the part you want is later.

Why does a 15 fps GIF run a little slow?

GIF stores each delay in hundredths of a second. One frame at 15 fps lasts 66.7 ms, which is rounded to 70 ms, so playback runs at 14.3 fps and 30 seconds of video take 31.5 s to play. The delays at 5 fps (20 hundredths) and 10 fps (10 hundredths) are exact.

Why is the Convert button grey?

It waits for the browser to report the video's duration and size. If the browser cannot decode the file, an error message replaces the Reading video metadata line; one cause is a video codec it cannot play, such as HEVC in some browsers.

Will a 4K or phone video be enlarged or shrunk?

It is only ever shrunk. The width is the smaller of your choice and the video's own width, and the height keeps the original shape. A 1080 x 1920 phone clip at 320 becomes 320 x 569.

Is the audio kept in the GIF?

No. GIF has no sound track, so only the picture is converted. If you need the sound, keep the MP4 or post it as a video.

Why did my GIF come out with only two frames?

The browser misread the video's length. An MP4 recorded by Chromium's own recorder (a fragmented MP4) was read by Firefox 155 as 0.134 seconds long, so the page made a 2-frame GIF, while Chrome 156, Chromium 153 and the WebKit build read it as 4.007 to 4.14 seconds and made 41 or 42 frames. If the frame count on the result card looks far too low for your clip, try the page in another browser.

Why does my GIF end on a frozen frame?

The video's stated length can run past its last picture. Our test MP4 reported 4.14 seconds while its last picture came at about 3.96 to 3.97 seconds, so the frames asked for after that showed the same picture again: one repeat at 10 fps and two at 15 fps, in all four engines we tried.

How many colors does the GIF keep?

At most 256 for the whole animation. On our generated test clip the GIFs used 224 to 247 palette entries, and a frame differed from the original by 3.25 to 3.81 levels per color channel on average (out of 255).

How long does the conversion take?

A 4.14-second MP4 took 0.6 to 4.4 seconds across nine settings and four engines; seeking through the video took most of it. Each frame is a separate seek, so the time grows with the number of frames, up to the 450-frame limit.

Related guide

Making a GIF from a video: size, frame rate and quality. The guide measures how file size grows with frames and pixels, using clips at 320, 480 and 640 px wide.

Related Tools