Sharing, Links & Measurement

URL Encoding

Definition

URL encoding, also called percent-encoding, is the rule for representing characters that cannot appear literally in an address. Only a small set is safe unescaped: letters, digits and a handful of marks such as hyphen, underscore, full stop and tilde. Everything else is written as a percent sign followed by the character's byte value in hexadecimal, so a space is %20, a hash is %23 and a question mark is %3F. Characters outside ASCII are first converted to UTF-8, which is why an e-acute takes two bytes and appears as %C3%A9. Reserved characters have a second life: they are legal in an address but carry structural meaning, so a question mark that belongs to a filename must be encoded or it will start the query string instead.

Why It Matters

A filename with a space in it is the most common broken link there is. Upload something called Q3 Report Final.pdf and the address contains spaces, which some clients encode, some turn into plus signs and some simply truncate — so the link works when you test it and fails when a colleague clicks it out of a chat window. Accented and non-Latin characters behave the same way, with the extra problem that the encoded form is unreadable and impossible to dictate over the phone. The fix costs nothing: rename the file to lowercase letters, digits and hyphens before you upload, and the question never comes up.

How It Works

Each part of a URL has its own safe set, so encoding is contextual rather than universal. In a path, a slash separates segments and has to become %2F if it is part of a name; in a query, an ampersand and an equals sign are separators and become %26 and %3D inside a value. Browsers handle most of this for you when you type or click, and they often display the decoded form in the address bar even though the encoded form is what went over the wire. Copying that friendly display into a plain-text email is exactly where links get mangled. Servers decode the path before matching it to a file, so a file genuinely named with a space in it is reachable only through its encoded address.

Real-World Example

A designer uploads a file called Brand Guide v2 (final).pdf and sends the address round. Two of the five recipients get an error, because their mail client stopped the link at the first space. Renamed to brand-guide-v2.pdf and republished at northwind-brand.99helpers.site, it works everywhere, survives a paste into plain text, and can be read aloud without spelling out percent signs.

Common Mistakes

  • Uploading files with spaces, brackets or ampersands in the name — the resulting address is fragile in precisely the clients you cannot test
  • Double-encoding — running an already encoded address through an encoder turns %20 into %2520 and the file is no longer found
  • Copying the decoded address out of the browser bar into plain text — what looks correct on screen may not survive the paste

Related Terms

Put a file online in seconds

Drop in a document, an image, a page or a whole static website and share the link — free, with no build step and no server to set up.

Host a file free →