Ever seen %20 in a web address where a space should be? That's URL encoding at work — here's why it exists and when you need to use it yourself.
Why URLs can't contain just any character
URLs are restricted to a limited set of safe characters (letters, numbers, and a handful of symbols like -, _, ., ~). Anything else — spaces, accented letters, &, ?, #, emoji — has to be converted into a safe representation first, or it risks being misread as part of the URL's structure (for example, & normally separates query parameters, so a literal & inside a value would break the URL).
How percent-encoding works
Each unsafe character is replaced with a % followed by its two-digit hexadecimal byte value. A space becomes %20, & becomes %26, and so on. Decoding simply reverses the process, turning each %XX sequence back into its original character. Modern URL encoding operates on UTF-8 bytes, so it can represent any character from any language, not just ASCII.
Where URL encoding shows up in everyday use
- Search queries — search for "coffee & tea" and you'll often see
coffee%20%26%20teain the address bar. - Form submissions — data submitted through a GET form is encoded into the URL's query string.
- Sharing links that contain special characters, like a URL with a query parameter that itself contains another full URL.
URL encoding vs. Base64 (people confuse these)
Both turn "unsafe" data into safe text, but for different jobs. URL encoding preserves readability — normal characters stay as-is, only unsafe ones are converted — and is meant specifically for use inside URLs. Base64 re-encodes everything into a completely different character set and is used more broadly, for any text-based transport, not just URLs. If you're encoding a full URL to embed as a value in another URL, encoding is the right tool; if you're encoding binary data like an image, that's a job for Base64 instead.
How to encode or decode a URL
Paste your text or link into the URL Encoder to safely encode special characters, or the URL Decoder to read an encoded URL in plain text.
FAQ
Why do some URLs use + instead of %20 for spaces?
That convention comes from HTML form submissions (application/x-www-form-urlencoded), where + represents a space specifically within the query string. %20 is the general-purpose encoding and works everywhere.
Is it safe to double-encode a URL?
No — encoding an already-encoded URL a second time will turn every % into %25, corrupting the link. Always check whether a value is already encoded before encoding it again.
Encode or decode a URL now
Try the free URL Encoder and URL Decoder. See more developer tools.
Related reading
For the binary-data equivalent of this problem, see What Is Base64 Encoding and When Should You Use It? Browse the full blog for more guides.
