Convert MKV to GIF

Converting MKV to GIF turns a few seconds of video into a silent looping image that pastes anywhere. There is one thing to settle before you start: the GIF always begins at the first frame of the file, and a Matroska recording is usually an hour or more long, so reaching a moment in the middle means trimming the clip out first and converting that.

  • Where it runs In your browser. The file is never uploaded.
  • Lossy Some detail is traded for size. GIF cannot hold everything an MKV can.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing A GIF stores every frame in full with at most 256 colours and no motion compensation, so it is many times larger than the video it came from. The defaults trim the clip to ten seconds at 480 pixels and twelve frames a second for that reason. Sound is lost — GIF has no audio.

Up to 100 files at once. Mixed formats are fine.

The GIF starts at the beginning, and your recording does not

This conversion samples frames at evenly spaced moments counted from zero. There is no start-time control and no way to add one, so whatever the first seconds of the file contain is what the GIF will show. On a short clip that is fine and usually what was wanted.

On a Matroska file it is almost never what was wanted, because these are long recordings — a film, a stream archive, a captured session — and the moment somebody wants is forty minutes in. The default result is ten seconds of a black frame or a distributor’s logo, which reads as a broken tool rather than as a missing feature. It is neither: it is the wrong order of operations.

Trim the moment out of the MKV first, then make the GIF

The fix is one extra step and it takes about a minute. Use the video trimmer here: give it the second the moment starts and the second it ends, and it returns just that span. Then bring the result to a GIF conversion, where starting at the beginning is now exactly what you want.

The trimmer hands back an MP4 whatever went in, so the second conversion is MP4 to GIF rather than this page — which is fine and is the same code doing the same job. It is worth knowing that the trim re-encodes rather than cutting at the nearest keyframe: the cut lands on the second you asked for, and the picture passes through a decoder and an encoder before the GIF stage sees it at all.

Why the defaults refuse to do what you asked

Ten seconds, 480 pixels wide, twelve frames a second. Those are deliberately modest and they exist because GIF has no concept of motion: it stores every frame as a complete image with at most 256 colours, one after another, with nothing describing what stayed the same. Every one of those three numbers multiplies the file size almost directly.

A ninety-second 1080p clip at its original frame rate would be a GIF of several hundred megabytes that no browser would display and no service would accept. The defaults produce something that fits in a chat window, an issue tracker or a documentation page, which is where GIFs actually go. Raise them deliberately and check the result, rather than assuming a larger number is better.

The 600-frame ceiling and the length you will really get

There is a hard limit of 600 frames on the encoder, and the Length control accepts up to sixty seconds without knowing about it. The two only agree at low frame rates: sixty seconds at twelve frames a second is 720 frames, so the result is cut to fifty. At thirty frames a second the same request yields twenty seconds.

The arithmetic is 600 divided by your frame rate, and it is worth doing before rather than being surprised after, because nothing on the page announces the truncation. The limit exists because a browser tab runs out of memory holding more than that many full frames — it is a real constraint rather than a policy, and the way around it is a shorter clip or a lower frame rate.

Colour, and why film suffers more than screen content

Each frame gets its own palette of 256 colours, chosen from what is actually in that frame. Per-frame rather than one palette for the whole clip is the more expensive choice and the only one that survives a cut: a single palette built on a bright scene renders a dark one in the wrong colours entirely.

No dithering is applied, and that is where the visible cost lands. Dithering scatters pixels to fake the colours a palette lacks; without it, a smooth gradient — a sky, a lit wall, a slow fade — becomes a set of visible bands. Flat graphics, interface panels, animation and screen recordings hold up extremely well because they contain few colours to begin with. Film and camera footage show it immediately.

Everything spoken in the clip is lost

GIF has no audio track, has never had one, and there is nothing in this conversion that could carry sound across. A moment that works because of what somebody says does not work as a GIF, and no setting recovers it.

It is worth pausing on because the destinations that require GIF are fewer than people assume. Most platforms that accept a GIF accept a short video too and will silently convert your GIF into one after you upload it — at which point you have paid GIF’s costs and received none of its compatibility. The places where GIF genuinely still wins are old forums, wikis, issue trackers, email signatures and documentation that cannot embed a player.

What width to choose when the source is a full-size recording

Four widths are offered — 320, 480, 640 and 800 pixels — and the height follows automatically so nothing is stretched. A 4K or 1080p recording has to come down a long way, and that is not a compromise: a GIF displayed in a chat window or a README is being shown at a few hundred pixels regardless of what is inside it.

The relationship is quadratic, so doubling the width roughly quadruples the frame data before compression. Going from 480 to 800 is a much larger change than it looks. Start at the default, look at the result at the size it will actually be displayed, and raise it only if something specific is unreadable.

Palettes and frames built inside the browser tab

The decoding, the resizing, the palette selection for each frame and the GIF assembly all happen on your own machine. Nothing carrying the recording is sent anywhere, there is no queue, and there is no watermark — the file is written by the same code whether you convert one clip or thirty.

It is also work, and a long clip at a high frame rate is hundreds of full images being quantised one after another. Expect a GIF to take longer than a still and about as long as a short video conversion. The free tier accepts an MKV up to 100 MB, which is another reason the trim-first route is the right one: a ten-second clip cut out of a two-hour recording is a small file by the time it reaches this page.

How to turn part of an MKV into a GIF

  1. Trim the moment out of the MKV first — the GIF always starts at the beginning of whatever you give it.
  2. Set the length, width and frame rate, remembering that 600 frames is the ceiling.
  3. Convert and check the GIF at the size it will actually be displayed before using it.

MKV and GIF: hours of video against a few hundred frames

MKV compared with GIF
MKVGIF
Full nameMatroska VideoGraphics Interchange Format
File extension.mkv.gif
Media typevideo/x-matroskaimage/gif
CompressionLossy — file size is bought with qualityLossless — nothing is discarded
First published20021987
Published byCompuServe
SpecificationMatroskaGIF89a
LicensingOpen standardOpen standard
Standing todayCurrentLegacy, still read everywhere
Bit depth8
Colour it can describeindexed palette
Largest image65,535 px per side
Opens in a browserSome browsersEvery browser
Considered insteadMP4, WebMWebP, MP4

What is lost

GIF stores at most 256 colours per frame. A photograph converted into one is reduced to a palette, which is what makes the sky look stepped rather than smooth — it is the format, not a quality setting.

Opening the result

GIF opens in every current browser. MKV has narrower browser support than that. If the file is going onto a web page or into a form, that is usually the whole reason for the conversion.

The usual programs do not overlap: MKV opens in VLC, MKVToolNix and HandBrake, GIF in GIMP, Adobe Photoshop and ImageMagick — so whoever receives the result needs something from the second list.

What each format is for

The two are aimed at different work: MKV at archiving and handing a finished file over, GIF at the web. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

MKV was published in 2002. The specification is Matroska, and it is worth reading if the file has to outlive the tool that wrote it.

GIF comes from CompuServe and dates from 1987, specified as GIF89a. GIMP, Adobe Photoshop and ImageMagick all read it.

GIF was published in 1987 and MKV in 2002. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

MKV to GIF: start times, length limits and file size

Are my MKV files uploaded anywhere?

No. This conversion runs entirely inside your browser, so the file never leaves your device. You can confirm it yourself: open the network tab of your browser's developer tools and convert something. You will see the page load, plus the analytics and advertising the site is paid for with — and nothing carrying your file. The engine behind this particular pair is mediabunny, a wrapper around WebCodecs, which borrows your device's own hardware decoders; your browser fetches it once and caches it.

Can I choose where in the MKV the GIF starts?

Not on this page. Every GIF made here begins at the first frame of the file, and there is no start-time control. On a long recording that means the GIF is of the black frame or the logo the recording opens with. Trim the file down to the moment first — the video trimmer here takes a start and an end and gives you back an MP4 — and make the GIF from that.

What are the defaults and why are they so conservative?

Ten seconds, 480 pixels wide, twelve frames a second. GIF stores every frame in full with no motion compensation, so length, width and frame rate all multiply the file size almost directly. Those three numbers produce something that fits in a chat window or a documentation page; the original resolution at the original frame rate would produce a file no browser would display.

I asked for sixty seconds and got less. Why?

Because there is a hard ceiling of 600 frames, which at twelve frames a second is fifty seconds and at thirty frames a second is twenty. The Length control accepts up to sixty regardless, so a long request at a high frame rate is silently shortened. Work out `600 divided by your frame rate` to know what you will actually get.

Why is the GIF larger than the video it came from?

Because the format has no way to describe motion. A video codec stores what changed between one frame and the next; a GIF stores complete images one after another, each limited to 256 colours. Ten seconds of a 480-pixel GIF routinely outweighs a minute of the original recording, and no setting changes the principle.

Does the GIF have sound?

No. GIF has no audio track and never has, so anything spoken in the clip is gone. If the words matter, an MP4 is the right format — every platform that still accepts GIF also accepts video, and most of them convert your GIF to video after you upload it anyway.

Why does the picture look grainy?

Because 256 colours is not many. A palette is chosen for each frame separately, which handles scene changes properly, and no dithering is applied — so smooth gradients such as a sky or a lit wall become visible bands rather than being broken up into noise. Flat graphics and screen content survive this far better than film does.

More about these formats

Where these figures come from

The claims this page makes about MKV and GIF are checkable, and these are the documents that settle them.