Gist raw URL shows %2520 instead of %20: why and fix
A Gist raw URL ending in %2520 instead of %20 comes from a space in the filename being encoded twice. Here is why it happens and how to fix it.
The Liite team11 دقيقة قراءة
Short answer
A space in a gist filename is showing up in the raw URL as %2520, which is a space encoded twice. Rename the file without spaces (my-notes.md), save, and copy the raw link again. If you can't rename, test the link with %2520 replaced by %20 before you share it.
You gave a gist file a name with a space in it, and its raw URL now ends in x%2520y instead of x%20y. The link can fail or point at a file name that doesn't exist. This is the problem people search for as:
gist raw url %2520
Why it happens
A space in a URL is written as %20. The % character can be encoded too, and its code is %25. Encode a space once and you get %20. Encode that result a second time and the % becomes %25, which gives %2520.
Here is the decoding in reverse:
x%2520y decode once -> x%20y
x%20y decode again -> x ySo a link ending in %2520 asks for a file whose name literally contains the characters %20, unless something decodes it twice. That mismatch is the likely reason such links fail.
We can't tell you which part of GitHub's code adds the second encoding, or whether it will be fixed. The only report we found is one thread in GitHub's community discussions from early November 2026. At the time it had only an automated reply and no answer from GitHub. The reporter's workaround was to avoid spaces in gist filenames. As of November 2026 there is no confirmation of a fix.
Where double encoding usually comes from
Double encoding is a general bug pattern, not something unique to Gist. It tends to happen when one layer builds a URL from a filename and encodes it, and a second layer takes that finished URL and encodes it again.
| Layer | What it does | Result for x y |
|---|---|---|
| Filename stored | Keeps the raw name | x y |
| First encode | Space becomes %20 | x%20y |
| Second encode | % becomes %25 | x%2520y |
For the Gist case, we don't know which layer repeats the step. Treat the table as an explanation of the symptom, not a diagnosis of GitHub's code.
Why it matters more for raw links than for pages
A raw link is meant to be consumed by something other than a person: a script, a package manager config, a documentation include, a chat bot. A browser tab might show you the file anyway, because a human notices the oddity and fixes it. A script does exactly what the URL says. If the path contains the literal text %20 where the file name has a space, the server looks for a file called x%20y, finds nothing, and returns an error.
That is also why the bug is easy to miss. The gist page looks fine, the file content looks fine, and only the copied raw address is wrong.
How to check that your link is affected
- Open the file in your gist and press Raw.
- Look at the end of the address in the browser bar.
- If the filename part contains
%2520where the space should be, you have this problem. If it shows%20, the link is normal.
The discussion only mentions spaces. We have no evidence about other special characters, so don't assume they behave the same way, and don't assume they are safe either. If your filename has parentheses, accents or symbols, run the same check on the raw address.
How to fix it
Fix 1: rename the file without spaces
- Open the gist and choose to edit it.
- Change the filename to use a hyphen or underscore, such as
my-notes.mdormy_notes.md. - Save the gist.
- Open the file, press Raw, and confirm the address has no
%in it.
With nothing to encode, there is nothing to encode twice. This is the fix the reporter used, and it is the only one we can recommend without caveats.
Old links
Links built from the old spaced name may keep the %2520 form or stop working after you rename. Replace them everywhere you pasted them: READMEs, docs, scripts, chat messages.
Fix 2: repair the URL by hand
If you must keep the space, replace %2520 with %20 in the address and see whether the file loads. This is based on how percent-encoding works, not on any documented GitHub behavior, so test the link in a private window before you share it. If it doesn't load, use Fix 1.
Fix 3: check whether GitHub has responded
Open the community discussion and see whether GitHub has replied. GitHub also publishes a status page, which is worth a look if links that worked yesterday now fail. A status incident is a different problem from a double-encoded name, so don't assume one explains the other.
If a script fetches the link
Rename the file before you wire the URL into a script. A script that decodes the path once will be left with %20 in the name, which is a different filename from the one with the space. Hard-coding a workaround for the double encoding also means your script breaks the day the bug is fixed.
What won't help
- Encoding the URL yourself before pasting it. Another layer of encoding turns
%2520into%252520. - Recreating the gist with the same spaced filename. The space is the trigger in the report, so expect the same result.
- Waiting for the link to correct itself. Nothing in the report suggests a link repairs itself later.
- Assuming a URL shortener will clean it up. A shortener stores the destination you give it. If you give it the double-encoded address, it redirects to the double-encoded address.
Checklist before you share a raw link
- The filename has only lowercase letters, numbers, hyphens and underscores.
- The raw address in the browser bar contains no
%. - You opened the link in a private window and the file loaded.
- Every old link built from the spaced name has been replaced.
- Any script that fetches the file uses the new address.
Gist or somewhere else: comparing the options
Once the link works, it is worth asking whether a gist is the right home for the file. The answer depends on who opens the link: a script that wants raw text, or a person who wants to read, view or download something.
| Option | Suits | Watch out for |
|---|---|---|
| Gist, renamed without spaces | Raw text for scripts and snippets | Raw links are tied to the filename, so renaming breaks old links |
| A file in a repository | Code that lives with a project | Same naming rules apply; the file sits in a project's history |
| GitHub Pages | A static site built from a repository | Needs a repository and setup; not a quick one-file link |
| Liite uploaded file | A page, PDF or file for people to open | Not a raw-text host; Markdown is rendered; Free sites expire |
| Liite paste | Sharing a block of text quickly | Not a file URL; no raw view |
This table sticks to what we are sure of. For GitHub's own hosting options, check GitHub's documentation for current limits and behavior, since those can change.
Gist
A gist is the lightest way to share a snippet with a developer audience. It keeps version history, and the raw view gives plain text that scripts can fetch. The trade-off is the one in this article: the raw address is built from the filename, so the filename is part of your public interface. Pick a name you can live with for a long time, and avoid spaces.
A file in a repository
If the file belongs to a project, putting it in the repository is more honest than a loose gist. It sits next to the code that uses it, and the same file-naming habits apply. The cost is overhead: you need a repository, and changing the file means a commit.
GitHub Pages
If you want people to see a rendered page rather than raw text, GitHub Pages serves a static site from a repository. It suits a documentation page or a small site, and it is more setup than a one-file link. Check GitHub's current documentation for its limits.
Liite uploaded files
Liite is a partial fit and not a Gist replacement. It works for the case where the file is meant for people, not scripts. You can upload a single .html file, a .zip, a PDF or any single file, and it is served at <slug>.liite.site. A slug is 3 to 30 characters: lowercase letters, numbers and single hyphens. Spaces can't appear in it, so this exact bug can't start with the site address.
What it does and doesn't do for a file like yours:
- Markdown is rendered. A
.mdfile is shown as a formatted page, not as raw text. If a script needs the raw Markdown source, this is the wrong tool. - Other text files get viewers. JSON and plain text have viewers, and CSV opens as a table (first 2,000 rows).
- PDFs open in a viewer with zoom and text search, and the download button can be switched off.
- Updating keeps the address. Upload again and the address stays the same, and old versions are kept for rollback.
- No server-side code. It won't run PHP or Node, and there's no API or CLI for uploading.
| Plan (as of November 2026) | Size per uploaded site | Expiry | Notes |
|---|---|---|---|
| Free | 3 MB | Goes offline 7 days after the last publish | Needs a card on file; always noindex |
| Pro, $8/mo | 25 MB | None | noindex only for the first 24 hours |
On Free, an expired site answers HTTP 410 "This site has expired", and an email goes out 2 days before. Republishing or upgrading keeps it up. That makes Free a poor home for a link you put in a README and forget. For anything long-lived, plan on a paid site, or stay with a repository file.
Liite pastes
If all you want to share is a block of text, a paste at liite.co/new avoids the filename problem because there is no filename. Pastes are rendered from Markdown, and you can set an expiry from 1 hour up to 30 days on a Free account. They have no raw view and no syntax highlighting, so they won't replace a gist for code. They suit notes, instructions and snippets meant to be read. See the new paste page to try one without an account.
Name files for the URL
Whichever host you use, name the file as if it were already part of a web address: lowercase, hyphens, no spaces. A name like release-notes.md passes through every layer unchanged.
Which one should you pick
- A script or tool must fetch plain text: keep the gist or a repository file, and rename it without spaces.
- A person should open or read it: an uploaded file or a rendered page serves them better than raw text.
- You want a PDF with a viewer: upload it as a file on a host that has a PDF viewer.
- It is temporary: a paste with an expiry is simpler than a gist you later have to delete.
For the full walk-through of uploading, see how to put an HTML file, a zip or a PDF online and the uploaded sites docs.
If nothing works
If renaming doesn't produce a clean raw link, contact GitHub Support, or add details to the existing community discussion. Include the exact raw URL as it appears, the filename you used, and the steps you tried. Say whether the file loads when you replace %2520 with %20.
Subject: Gist raw URL shows %2520 instead of %20
Hello,
A gist file whose name contains a space gets a raw URL where the space
appears as %2520 (double-encoded) instead of %20.
Gist URL: <paste the gist address>
Filename: <the name with the space>
Raw URL shown: <paste the raw address>
Date first noticed: <date and time with time zone>
I tried renaming the file without spaces (result: <worked / did not work>)
and replacing %2520 with %20 by hand (result: <loaded / did not load>).
Could you confirm whether this is a known issue and whether a fix is planned?
Thank you.Common questions
Is %2520 the same as a space?
No. After one round of decoding, %2520 becomes the text %20, not a space. It only becomes a space after a second round.
Does it matter for a link I only open in my browser?
It can. A browser sends the path as it is written, so a name containing %2520 is requested as given. The same link may behave differently in a script or an app that decodes it a different number of times.
Which characters are safe in a filename that will be linked?
Lowercase letters, numbers, hyphens and underscores need no encoding at all, so they pass through every layer unchanged. Name the file for the URL from the start if it will ever be linked.
Will renaming the file break old links?
Probably, yes. Links built from the old spaced name may stop working or keep the %2520 form, so replace them wherever you pasted them.