Developer tools

GitHub URL Parser

GitHub URL Parser

Split GitHub URLs into owner, repo, branch and path, and get raw, clone, ZIP and CDN links.

About this tool

About GitHub URL Parser

Turn any GitHub link into the one you actually need. Paste a repository, folder or file URL, a raw.githubusercontent.com link, an SSH address like git@github.com:owner/repo.git, a jsDelivr URL, a pull request, issue, commit, release or gist, or just owner/repo, and the parser splits it into owner, repository, branch, tag or commit, path and line range. From that it builds every related link: the blob and raw file, the folder, blame and file history, HTTPS and SSH clone commands, a shallow clone of just that branch, gh repo clone, ZIP and tar.gz archive downloads, an npm install from GitHub, and a jsDelivr CDN URL for serving a file. Pull requests also get .diff and .patch links and a gh pr checkout command. GitHub URLs don't mark where a branch name ends, so when a branch contains a slash you can tell the tool how many segments it has. Parsing is pure text work in your browser; no request is sent to GitHub.

Built and maintained by Abhi JainUpdated

How to Convert a GitHub URL

  1. 1

    Paste the URL

    Paste any GitHub link into GitHub URL, or click one of the examples.

  2. 2

    Fix the branch if needed

    If the branch name contains a slash, raise Segments in branch name. Set Default branch for URLs without one.

  3. 3

    Copy a link

    Copy the raw file, clone command, ZIP download or any other link under Links & commands, or open it in a new tab.

GitHub URL Parser: questions and answers

How do I get the raw URL of a file on GitHub?

Replace github.com with raw.githubusercontent.com and remove /blob from the path: github.com/owner/repo/blob/main/file.txt becomes raw.githubusercontent.com/owner/repo/main/file.txt. Paste the file URL here and copy the Raw file link.

How do I download a GitHub repository as a ZIP?

Use https://github.com/owner/repo/archive/<branch-or-tag>.zip, for example /archive/main.zip or /archive/v1.2.0.zip. The archive contains the files at that ref without git history.

What is the difference between HTTPS and SSH clone URLs?

HTTPS (https://github.com/owner/repo.git) works everywhere and authenticates with a personal access token or credential manager. SSH (git@github.com:owner/repo.git) uses an SSH key you add to your GitHub account and doesn't prompt for a password.

Can I use jsDelivr to serve files from GitHub?

Yes, for public repositories: https://cdn.jsdelivr.net/gh/owner/repo@ref/path serves the file with proper content types and caching. Pin a tag or commit rather than a branch in production, because branch URLs are cached and can change.

Why is the branch name wrong for some URLs?

In github.com/owner/repo/tree/feature/login/src, GitHub doesn't mark whether the branch is feature or feature/login. Without asking GitHub, the tool assumes one segment; set Segments in branch name to 2 to read it as feature/login.