Storing your CSS, JavaScript or images on GitHub is easy, but using a GitHub link directly on your website usually does not work. The GitHub to jsDelivr Link Converter above turns GitHub file, folder and raw links into jsDelivr CDN links that you can use in your pages. You can convert many links at once, choose the version, and copy ready-made HTML tags. The tool runs in your browser, and your links are not sent anywhere.
Table of Contents
Why You Should Not Use GitHub Links on Your Site
GitHub's "raw" links are made for viewing and downloading files, not for serving them to websites. They are delivered as plain text, with a header that tells browsers not to guess the file type. In most cases, this means a browser will refuse to run a script or apply a stylesheet loaded from a raw link. GitHub is also not a content delivery network (CDN), so it is not built for fast delivery to visitors around the world.
What Is jsDelivr?
jsDelivr is a free CDN for open source files. Besides npm packages, it can serve files straight from public GitHub repositories. The link format is simple:
https://cdn.jsdelivr.net/gh/user/repo@version/file
The version part can be a release tag, a commit hash or a branch. According to the official jsDelivr documentation, you can also use a version range such as @3 or @3.1, or use @latest. If you leave the version out, you also get the latest files, but jsDelivr does not recommend this for production use.
How to Use the GitHub to jsDelivr Link Converter
- Paste your GitHub links. Add one link per line. You can paste file, folder, raw or repository links. Click Try Sample to see examples.
- Choose the version. Keep the version from your link, remove it, or enter your own tag or commit.
- Choose the output format. Pick URL only, an HTML tag, or Markdown.
- Check the details. Each link shows whether it was converted, plus a short note about caching or versions. Click Open to test the new link.
- Copy the result. Click Copy All and paste the links where you need them.
Supported Link Types
| GitHub link | jsDelivr result |
|---|---|
github.com/user/repo/blob/main/css/style.css |
cdn.jsdelivr.net/gh/user/repo@main/css/style.css |
raw.githubusercontent.com/user/repo/main/js/app.js |
cdn.jsdelivr.net/gh/user/repo@main/js/app.js |
github.com/user/repo/tree/v1.0.0/images |
cdn.jsdelivr.net/gh/user/repo@v1.0.0/images/ (folder listing) |
github.com/user/repo |
cdn.jsdelivr.net/gh/user/repo/ (repository root) |
The tool understands the newer raw link style with refs/heads/ or refs/tags/ in the path. It ignores extras such as ?raw=true and line anchors like #L10. Release assets (/releases/download/) and Gists are not converted, because jsDelivr serves files stored in repositories.
Settings Explained
- Keep version. Uses the branch, tag or commit that was in your GitHub link.
- Remove version. Creates a link without a version, which serves the latest files. Fine for testing, but risky for a live site.
- Custom version. Replaces the version in every link with the one you type, for example
v1.2.0. - HTML tag output. Creates
<script>for JS files,<link rel="stylesheet">for CSS files and<img>for common image types. Other files stay as plain URLs. - Markdown output. Creates image or link syntax for use in Markdown text.
- Use minified file. Adds
.minto JS and CSS file names. jsDelivr documents that adding.minreturns a minified version, and that it generates one if none exists.
Which Version Should You Use?
The version you choose decides how stable your link is.
| Version type | Example | Best for |
|---|---|---|
| Commit hash | @32b0037 |
The most stable option. The files never change. |
| Release tag | @v1.2.0 |
Stable and easy to read. Recommended for most sites. |
| Branch | @main |
Testing. Files on a branch can be cached for a long time, reportedly around 12 hours by default. |
No version or @latest |
/gh/user/repo/file |
Quick tests only. Not recommended for production. |
If you update a file and the old one still shows, you can purge the cache with jsDelivr's purge tool. A cleaner habit is to create a new tag or commit for every change and update your link to it.
Using the Links on Blogger
- CSS. Paste the
<link>tag inside the<head>section of your theme (Theme, then Edit HTML). - JavaScript. Paste the
<script>tag just before</body>so it does not slow down the first view of your page. - Images. Use the
<img>output inside your post in HTML view, and add a usefulaltdescription. - Back up first. Download a backup of your theme before you edit it.
Limitations to Know
- Branch names with slashes. A name like
feature/logincannot be separated from the file path in a GitHub link. The tool takes the first part as the branch. For such cases, copy a link that uses a commit hash instead. - The tool does not check that the file exists. Click Open to test each link, and make sure your repository is public.
- No integrity hash. The tool does not create Subresource Integrity (SRI) attributes.
- Only GitHub repository links. Release assets, Gists and other hosts are skipped with a clear message.
Frequently Asked Questions
Is the GitHub to jsDelivr Link Converter free?
Yes. The tool is free and runs in your browser. jsDelivr is also a free CDN for open source files.
Why does my raw GitHub link not work as a script or stylesheet?
Raw GitHub links are served as plain text and tell browsers not to guess the file type, so browsers usually refuse to run or apply them. A CDN link from jsDelivr is served with the correct type for the file.
Does it work with private repositories?
No. jsDelivr serves files from public repositories. If the repository is private, the converted link will not load.
Why does my updated file not change on the jsDelivr link?
jsDelivr caches files, and branch links can stay cached for hours. Use a new tag or commit for each change, or purge the file with jsDelivr's purge tool.
Should I use the .min option?
Yes, for JavaScript and CSS on a live site, because smaller files load faster. jsDelivr minifies the file if no minified version exists. Test your page after switching, to be sure everything still works.
Can I convert many links at once?
Yes. Paste one link per line. Valid links are converted, and links that cannot be converted are listed with a short reason.
Final Thoughts
Hosting files on GitHub and serving them through jsDelivr is a simple, free way to keep your site files organized and fast. Convert your links, pin them to a tag or commit, test each one with the Open link, and your pages will load the right files every time.