Links break when they contain characters that URLs were never designed to carry. Spaces, ampersands, question marks, and accented letters all need special handling before a link can travel safely through a message, an email, or another web page. URL encoding is the system that handles them.
This guide explains what encoding does in plain language, shows you how to encode a URL for sharing, and covers the mistakes that break links most often.
What URL encoding does
A URL can only safely contain a limited set of characters: letters, digits, and a few symbols like hyphens, underscores, periods, and tildes. Everything else must be converted into a safe form. URL encoding, also called percent encoding, replaces each unsafe character with a percent sign followed by two hexadecimal digits.
A space becomes %20. An ampersand becomes %26. An equals sign becomes %3D. The receiving browser or server decodes these back to the original characters, so the link still works. You see the encoded form in the address bar, but the destination understands the original meaning.
Why links break without encoding
Consider a search link that contains the words “coffee and tea”. If the space and the word “and” are left raw, some apps will cut the link at the first space, sending only part of it. An unencoded ampersand is worse: in a URL, an ampersand separates parameters, so an ampersand inside your data gets misread as the start of a new parameter. The page then receives the wrong values, or fails entirely.
Accented letters and other non-English characters cause similar trouble. They must be encoded as sequences of percent codes, one per byte, before the link is shared. Browsers often do this automatically in the address bar, but links pasted into messages, documents, or code do not always get the same treatment.
Encode the value, not always the whole URL
This distinction matters more than any other rule. When you share a complete link, you usually want to keep its structure intact: the colons, slashes, question marks, and ampersands that organize the URL should stay as they are, while only the data inside it gets encoded.
When you place a value inside a link, such as a search term or a message, encode that value fully. For example, to share a search for “coffee and tea”, encode the search term as coffee%20and%20tea and place it after the q= in the URL. Encoding the whole URL instead would also encode the slashes and question mark, turning a working link into a useless string.
Common characters and their codes
- Space:
%20(in form data, a plus sign+is also used for spaces) - Ampersand
&:%26 - Equals sign
=:%3D - Question mark
?:%3F - Hash
#:%23 - Slash
/:%2F(only when it is data, not a path separator) - Percent sign
%:%25 - Plus sign
+:%2B
You do not need to memorize this table. You need to recognize the pattern: if a character has a job in URL structure, encode it when it appears as data instead.
Mistakes that break links
The most common mistake is double encoding: encoding a link that is already encoded. A space encoded once is %20. Encoded again, the percent sign itself becomes %25, giving %2520, which decodes to the literal text %20 instead of a space. Always check whether a link is already encoded before you encode it.
Other mistakes include using + for spaces in a path, where only %20 is correct, and forgetting to encode characters in file names shared as links. If a link works in your browser but fails when someone else clicks it from a message, encoding is the first thing to check.
Try the free tool
You can encode by hand for a short value, but for a long link with many special characters, a tool is faster and less error-prone. Paste your URL or value into the tool below to encode or decode it instantly. Open the full URL Encoder Decoder tool on its own page.
Quick checklist
Encode data values fully, keep URL structure intact, encode once and only once, and test the final link by clicking it from the place you will share it. Follow those four rules and your shared links will survive pasting into any app.
