GitHub URL Parser

Paste a GitHub address. You get its owner, repository, branch, path and lines, and the other addresses for the same file: raw, file view, clone and ZIP.

How it works

The address is read on this page with the browser's own URL parser, then split into segments. The first two segments after github.com are the owner and the repository. The words blob, tree, raw, commit, pull and issues say what kind of page it is.

For a file, the segment after blob is taken as the branch, tag or commit, and the rest is the path. A #L10-L20 fragment becomes the line range.

The other addresses are built from those parts. Nothing is fetched from GitHub, so the tool works offline and never learns which repository you looked at.

How to use it

  1. 1 Copy an address from your browser bar, a README or a chat. A git@github.com: clone address works too.
  2. 2 Paste it into the box. The parts appear as you type.
  3. 3 Check the branch row if the branch name might contain a slash.
  4. 4 Press Copy beside the address you need, such as Raw file or Clone over SSH.

Good to know

  • A raw address gives the file's bytes with no GitHub page around it. Use it with curl, wget or a script.
  • To link to code that will not change, use a commit instead of a branch. On a GitHub file page, pressing y swaps the branch for the commit in the address bar.
  • The ZIP address downloads the files at that ref without the git history. Use the clone address when you need the history.
  • Lines are kept on the file view address, so the link opens with those lines highlighted.

Browser support

  • Chrome 94 and later
  • Firefox 93 and later
  • Safari 16.4 and later
  • Edge 94 and later

These are the oldest versions with everything the tool uses. They are worked out from the tool itself, so they change when it does.

Version numbers checked on 2026-09-04.

One file on GitHub, five addresses, and how to move between them

GitHub gives the same file several addresses, and each one does a different job. Take a file at github.com/vitejs/vite/blob/main/packages/vite/package.json. That address opens a web page with the file inside it, line numbers, a history button and the rest of GitHub around it. It is the right link to send a person. It is the wrong link to give curl, because curl would download the HTML of that page and not the file.

For a script you want the raw address: raw.githubusercontent.com/vitejs/vite/main/packages/vite/package.json. It has a different host and no /blob segment, and it returns only the file's bytes. Paste the first address into this tool and the Raw file row shows exactly that. It works the other way too. Paste a raw address that a build log printed, and the File on GitHub row gives you the page a person can read.

Line ranges travel with the file view. Add #L10-L20 to a file address and GitHub highlights lines 10 to 20 when it opens. The tool reads that fragment, shows the range, and keeps it on the file view link it builds. It drops it from the raw link, because a raw file has no page to highlight. The same parts also give the clone addresses. https://github.com/vitejs/vite.git works anywhere, and git@github.com:vitejs/vite.git works when you have an SSH key on your account. The ZIP address, github.com/vitejs/vite/archive/main.zip, downloads the files at that branch without any git history.

One part of a GitHub address cannot be read with certainty. Branch names may contain slashes, so /blob/release/2.0/README.md could mean the branch release and the file 2.0/README.md, or the branch release/2.0 and the file README.md. Both are valid, and GitHub decides by checking which branches exist. This tool cannot check, because it never contacts GitHub. It takes the first segment as the branch, like most scripts do, and puts a note beside the branch when a path follows it. If your branches use slashes, fix the split by eye.

The other limits are simple. The tool reads github.com addresses and SSH clone addresses. It does not read GitHub Enterprise hosts, Gists or other code hosts such as GitLab. It does not check that the repository, branch or file exists, so an address with a typo produces neat links to nothing. Everything happens on this page, so you can use it on addresses from private repositories without telling anyone which ones they are.

Frequently asked questions

How do I turn a GitHub file link into a raw link?

Paste the file link here and copy the Raw file row. By hand: change github.com to raw.githubusercontent.com and remove /blob from the path. So github.com/o/r/blob/main/a.ts becomes raw.githubusercontent.com/o/r/main/a.ts.

Why does the tool say the branch might be wrong?

Branch names can contain slashes, such as feature/login. In /blob/feature/login/a.md, the address alone cannot say if the branch is feature or feature/login. Only GitHub knows, by looking the branch up. The tool takes the first segment and tells you to check it.

Does this work for private repositories?

It takes the address apart the same way, because it never contacts GitHub. The links it builds still need you to be signed in, and a raw link to a private file needs a token when used from a script.

Is the address I paste sent anywhere?

No. Parsing runs in this page, and nothing is requested from GitHub or from YappyKit's server.

Related tools

Your files are processed on your device and are not uploaded. You can verify this in your browser’s developer tools under the Network tab.