Have you ever pasted a URL with a space or an ampersand into an email, only to find it stops working? That's because URLs can only contain a limited set of characters. URL encoding — also called percent-encoding — is the system that translates everything else into a form browsers and servers can handle.
Why URLs can't just use any character
A URL is parsed according to a strict grammar, and certain characters have special meanings. The question mark ? starts a query string, the ampersand & separates parameters, the hash # marks a fragment, and a slash / separates path segments.
If one of those characters appears inside a value — say, a search term containing & — the parser can't tell whether it's meant to be a separator or literal data. The result is a URL that breaks, or that gets interpreted the wrong way.
How percent-encoding works
URL encoding replaces an unsafe character with a percent sign % followed by two hexadecimal digits that represent the character's byte value in UTF-8. A few everyday examples:
- Space becomes
%20(or+in query strings). - Ampersand
&becomes%26. - Question mark
?becomes%3Fwhen it's data, not a query delimiter. - Hash
#becomes%23. - Equals
=becomes%3D.
Letters, digits, and a small set of "unreserved" characters (-, _, ., ~) pass through unchanged. Everything else gets encoded.
Encoding vs. decoding
Encoding takes human-friendly text and converts it into a URL-safe string. Decoding does the reverse — it turns %20 back into a space so you can read the original value. They're two directions of the same process.
A common mistake is double-encoding: encoding a string that's already partially encoded, turning %20 into %2520. If a URL looks "extra long" or contains lots of %25, it has probably been encoded more than once.
When you'll actually need this
- Building query strings — appending search terms, filters, or IDs to a URL by hand.
- Working with APIs — parameters in REST calls must be encoded so the server parses them correctly.
- Debugging links — decoding a messy URL to see what the original text actually was.
How to encode or decode a URL
You don't need to memorize the hex table. Use our free URL Encoder / Decoder:
- 1.Paste the text or URL you want to work with.
- 2.Choose Encode to make it URL-safe, or Decode to turn it back into readable text.
- 3.Copy the result and use it in your link, query string, or API call.
Like every tool on Tool Vault, it runs entirely in your browser — nothing you paste is sent to a server.
Frequently asked questions
What's the difference between URL encoding and HTML encoding?
They solve different problems. URL encoding makes text safe to put inside a URL (space becomes %20). HTML encoding makes text safe to put inside an HTML document (angle brackets become < and >).
Should I use %20 or + for spaces?
Both are common, but they're formally used in different places: %20 is valid anywhere, while + is specifically for spaces in the query string (the part after ?). To be safe, %20 always works.
Can a URL be decoded multiple times?
Technically yes, but decoding more times than it was encoded will corrupt the text. If you see %25 everywhere, the string was likely double-encoded and needs decoding twice.
Need to encode or decode a URL?
Try the free, in-browser URL Encoder / Decoder — no signup, no uploads, instant results.
Encode / decode now