If you want to add a video to a GitHub README, the short answer is: drag an .mp4 or .mov into a GitHub text box, wait for the link it gives you, and put that link in your README. The long answer is that there are two other routes (a GIF, or a thumbnail that links to YouTube or Loom), and the right one depends on whether you need sound, autoplay or a file bigger than 10 MB. I build ReelMint, a video studio for developers, so I have a stake in demo videos existing at all. This post is the how-to I wanted, with the limits checked against GitHub's own docs on 3 November 2026.
The three ways to add a video to a GitHub README
- Upload the file directly. GitHub hosts it and shows a player with controls. Sound works, autoplay does not (more on that below).
- An animated GIF. Embedded as an image, so it loops on its own, but it is silent and gets large fast.
- A clickable thumbnail. A static image wrapped in a link to YouTube or Loom. It hosts nothing on GitHub and has no size limit you control, but the video plays on another site.
There is also a fourth, less useful option: committing the video file into the repository or attaching it to a release. I cover where that fits in the comparison section.
Method 1: upload the video file directly
GitHub's docs on attaching files say you can attach a video by dragging and dropping it into the comment box, and list the supported video formats as .mp4, .mov and .webm. After the upload, "the text field is updated to show the anonymized URL for the file". That page covers issues, pull requests and comments. It does not mention READMEs, so the README steps below combine the documented upload with what other maintainers have reported working.
The steps:
- Open any GitHub text box that accepts attachments. A comment on an issue or pull request in your own repo is the safest one. Do not submit the comment.
- Drag your .mp4 into it and wait until the text box shows a URL on github.com. Contributors on public repos report the form https://github.com/user-attachments/assets/ followed by a UUID. GitHub's docs only call it an anonymized URL, so treat that exact shape as observed rather than guaranteed.
- Copy the URL, then paste it into your README on its own line, or inside a video tag.
- Commit, then open the rendered README on github.com and confirm it shows a player. Check this in a private window too.
Either of these goes in your README.md:
https://github.com/user-attachments/assets/REPLACE-WITH-YOUR-UPLOAD-ID
<video src="https://github.com/user-attachments/assets/REPLACE-WITH-YOUR-UPLOAD-ID" controls width="720"></video>
The size limits are the part people get wrong. GitHub's docs state 10 MB for videos uploaded to a repository owned by a user or organization on a free plan, and 100 MB on a paid plan. Images and GIFs are capped at 10 MB, and other files at 25 MB. Note the wording: it is the plan of the repository owner, not of the person uploading.
Two behaviours worth knowing, both reported by maintainers rather than documented by GitHub. First, the asset URL is not a public link: one project found that a thumbnail linking straight to a user-attachments URL gave anonymous visitors a 404, because GitHub serves these only when embedded in rendered Markdown. Second, the HeyGen Hyperframes project tried an MP4 in a video tag, found GitHub strips autoplay and loop so it needs a click, and switched its README hero to an animated WebP image instead.
The docs also say files in public repositories can be accessed without authentication, while for private and internal repositories only people with access to the repository can view them. So an upload into a public repo's comment box is effectively public, even if you never submit the comment.
Method 2: animated GIF
A GIF is just an image, so it needs no special handling. Commit it to the repository and reference it with a relative path, which GitHub's docs recommend over absolute links for images in the repo:

<img src="docs/demo.gif" alt="Demo of the CLI" width="720">
The upside is real: it autoplays and loops without a click, and it renders everywhere Markdown does, including npm and package registries that drop video tags. The Hyperframes PR above noted that most non-GitHub renderers, npmjs.com among them, strip the video tag.
The downsides: no audio, a 256-colour palette that makes gradients and syntax highlighting look rough, and large files for anything longer than a few seconds. Because GitHub caps images and GIFs at 10 MB on upload, a long terminal session will not fit through the upload path, though a GIF committed into the repo is subject to the repository file limits instead: GitHub warns above 50 MiB and blocks files larger than 100 MiB.
If you are making the GIF from a terminal session, a tool such as vhs can write one directly. Its README lists GIF, MP4 and WebM as output formats and requires ttyd and ffmpeg on your PATH. More on that in the last section.
Method 3: clickable thumbnail to YouTube or Loom
This is the oldest trick and still the only one with no size cap: a normal image, wrapped in a normal link. The pattern is a Markdown image inside a Markdown link:
[](https://www.youtube.com/watch?v=VIDEO_ID)
Replace VIDEO_ID with the 11-character ID from your YouTube URL. I checked the img.youtube.com thumbnail URLs for hqdefault.jpg and maxresdefault.jpg against one public video today and both returned 200. maxresdefault.jpg is not generated for every video, so hqdefault.jpg is the safer default. For Loom, take a screenshot of the first frame, commit it to your repo, and use that path as the image, because I did not verify a stable public thumbnail URL for Loom.
What you give up is inline playback: the reader clicks, leaves GitHub and lands on the video site. What you get is a platform that handles hosting, streaming, captions and a link you can share elsewhere.
Which method should you use?
- Short demo, sound matters, under your size limit: upload the file (Method 1).
- A 5 to 15 second loop, no sound needed, must work on npm and elsewhere: GIF (Method 2). If it is too heavy, an animated WebP via an img tag is the alternative Hyperframes chose, though I did not test WebP support beyond their report.
- Longer than a couple of minutes, or over your plan's cap: thumbnail link to YouTube or Loom (Method 3).
- You need autoplay with a real video: none of the three reliably gives it as an MP4. Use a GIF or WebP.
On the fourth option: you can commit a video file to the repo, but a relative path in a video tag has been reported not to render in a README, and GitHub warns at 50 MiB and blocks above 100 MiB, with a recommended repository size of ideally under 1 GB. Release assets are a better home for large files, since each file can be up to 2 GiB with no limit on a release's total size, but the README link then points at a download, not an inline player. I did not test whether a release-asset MP4 plays inline, so do not count on it.
Making the demo video itself
Everything above assumes you already have a file. Three honest ways to get one:
- Screen recording. Free, fast and exactly what happened. The cost is retakes and no way to fix a typo after the fact. We compared the options in best terminal recording tools for CLI demos.
- vhs for terminal demos. You write a .tape file (Output demo.gif, Type, Enter, Sleep) and run vhs demo.tape, so the recording is reproducible and lives in version control. It is built for terminals, not for explaining architecture.
- ReelMint for a narrated demo. You give it your README, it drafts a script, and each line becomes an editable scene such as a typed terminal, a code card or a diagram. An agent like Claude Code or Cursor can drive it over our MCP server at https://studio.reelmint.io/api/mcp, with 130+ MCP tools behind it. Our write-up turning a GitHub README into a demo video shows the flow, and the README to Short page is the product page.
When ReelMint is not the right pick
Plenty of the time it is the wrong tool. If you want a 10 second looping clip of one command running, record it with vhs or a screen recorder; that is faster and shows the real output. ReelMint produces a composed, narrated video, not a capture of your actual terminal, and it is built around vertical 9:16 Shorts, so for a widescreen README banner a screen recording is the better fit. Also, a first reel is not instant: our own measurement for a 60 to 90 second reel is 45 to 60 minutes elapsed, 10 to 20 minutes of it hands-on, from one person who built the product.
Where it does fit: a project with a story to tell in 60 to 90 seconds, a README that already works as a script outline, and a plan to publish the same video on YouTube Shorts as well as in the repo. You can try the free tier with your own API keys; see pricing.
Can a GitHub README autoplay a video?
Not reliably as an MP4. GitHub's docs do not document autoplay for video, and maintainers report that GitHub strips autoplay and loop from video tags in Markdown, so viewers have to click play. GIFs and animated WebP images, being images, do animate on their own.
What is the GitHub README video size limit?
GitHub's attaching-files docs set 10 MB for videos uploaded to repositories owned by a user or organization on a free plan and 100 MB on a paid plan. Images and GIFs are capped at 10 MB, other files at 25 MB. Files committed into the repo follow different limits: a warning at 50 MiB and a block at 100 MiB.
Should I use a GIF or an mp4 in my README?
Use an mp4 uploaded through GitHub when you need sound, sharper text or a longer clip, and accept that it needs a click. Use a GIF when you want a silent, instant loop that also renders on npm and other sites that strip video tags. For anything past a minute, link a thumbnail to YouTube or Loom instead.
If you are launching an open-source project, promoting an open-source project with a demo video covers what to do with the video once the README has it.
Related