A link can look perfect and still arrive broken. You paste an address into an email, a chat message or a document, the other person clicks it, and the page loads with the wrong filter applied, a search term cut in half, or no results at all. Nothing about the address looks wrong, which is what makes this class of bug so irritating to track down.

The culprit is usually one raw character inside a value: an ampersand, a hash sign or a plain space. Inside a URL those characters are not text. They are punctuation with jobs to do, and both the browser and the server obey them. This guide shows how to work out which character broke your link, and how to repair it with the free URL Encoder/Decoder on Ovatly: encode the value in Component mode, then rebuild the address around it.

Contents

  • Quick answer
  • The three characters that break links
  • How to diagnose a broken link
  • How to fix a broken link, step by step
  • Worked example: repairing a category link
  • Limitations and honest warnings
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Find the value inside the link that contains a raw &, # or space, and percent-encode that value on its own. Open the URL Encoder/Decoder, choose Component mode, paste just the value, and press Encode. Component mode encodes everything a URL cannot carry raw, including &, =, ? and /, so the encoded text can sit inside a query string without being mistaken for structure. Then rebuild the link with the encoded value in place, leaving the address itself and its genuine separators exactly as they were.

The ampersand ends your value early. In a query string, & is the separator between one parameter and the next. When a value itself contains an ampersand, the server cannot tell where the value ends and the next parameter begins, so it splits at the first & it meets. A category value of Home & Garden placed raw into a link arrives as a category of Home, followed by a stray parameter that nobody asked for. The page then filters on half a value and shows the wrong results, or none.

The hash sign moves the rest out of the request. Everything after a # in a URL is a fragment: an instruction for the browser about where to land on the page. Fragments are never sent to the server at all. That is harmless when the # is deliberate, but destructive when it belongs to the value. Search for C# through a raw link and the server receives a search term of C, while # and everything after it stays behind in the browser.

The space truncates the copy. A URL cannot carry a raw space. When you type an address with spaces into a browser, the browser quietly fixes it up for you, which hides the problem. A link copied out of a document or an email gets no such help: it can be cut at the first space. A file name like my report.pdf is a classic casualty.

Read the link left to right and split it at its punctuation. Find the ? that starts the query string, then split the rest on &. Every piece should look like name=value. A piece with no = in it, or a name you do not recognise, is the fingerprint of a raw ampersand inside the previous value. Next, count the # signs: a working link has at most one, near the end. A # sitting in the middle of a value means the value was cut there. Finally, look for literal spaces: each one is a place where the link can snap when copied.

Once you know which character did the damage, the repair is always the same shape: take the whole original value and encode it.

  1. Copy the broken link and identify the value that contains the offending character.
  2. Open the URL Encoder/Decoder and choose Component mode.
  3. Paste only the value into the box, not the whole address.
  4. Press Encode and copy the result.
  5. Rebuild the link with the encoded value in place. Leave the ? before the query string and the & separators between parameters raw: they are structure, not data.
  6. Test the rebuilt link and confirm the page now receives the full value.

Here is a broken link to a product listing, the kind that gets pasted into a spreadsheet or a message:

https://example.com/products?category=Home & Garden&page=2

Read it the way the server does. The query string splits on &, so the server receives three parameters: category with the value Home , a stray parameter named Garden with no value, and page with the value 2. The category filter looks for "Home" and the listing comes back wrong.

Now repair it. The intended value is Home & Garden. Paste that value into the URL Encoder/Decoder in Component mode and press Encode:

Home%20%26%20Garden

The spaces became %20 and the ampersand became %26, a code that means "an ampersand character" rather than "new parameter". Rebuild the link with that value in place:

https://example.com/products?category=Home%20%26%20Garden&page=2

The one remaining raw &, the one before page=2, is the genuine separator, and it stays. The server now receives exactly two parameters, and category decodes back to the full Home & Garden.

The same repair handles the hash sign. A raw search link for C# reaches the server as q=C; encoding the value gives C%23, and https://example.com/search?q=C%23 delivers the whole term.

Limitations and honest warnings

Encoding fixes characters, not destinations. If the domain, the path or a parameter name is wrong, the encoded link will be a perfectly formatted link to the wrong place. Check the address itself before blaming its characters.

Encoding is also not encryption. A percent-encoded value can be decoded by anyone with this same tool, so never treat an encoded link as a way to hide a token, an email address or anything else sensitive that happens to sit inside it.

Watch for values that are already encoded. If a value already contains %20, encoding it again turns the % into %25, and the server decodes it back to a literal %20 instead of a space. Decode first if you are unsure: the tool reports a clear error on invalid input, such as a stray % or an incomplete %2 at the end, rather than printing garbage.

Common mistakes

  • Encoding the whole address in Component mode. That turns the ://, the ? and the separators into codes and destroys the link. Whole addresses belong in Full URL mode, which encodes spaces and stray characters while keeping the structure intact.
  • Fixing only the first bad character. A value with an ampersand and two spaces needs all three encoded. Encode the entire value in one pass.
  • Encoding a value twice. One round of encoding is the repair; a second round is a new bug, with %25 scattered through the result.
  • Assuming a link is fine because it worked when you typed it. Browsers silently repair spaces in typed addresses; the same address copied into an email gets no repair, which is why the recipient's click fails when yours did not.
  • Encoding the parameter name and the separators along with the value. Only the value is data. The name, the = and the & between parameters must stay raw for the string to parse.

FAQs

Why does my link stop working after an & sign? Because in a query string the & is the separator between parameters. A raw & inside a value ends that value early and starts a new, unintended parameter, so the page receives only the first part of what you meant to send.

Why does everything after a # disappear? The # begins the fragment part of a URL, which stays in the browser and is never sent to the server. A search for C# reaches the server as just C unless the # is encoded as %23.

Which mode should I use to fix a broken value? Component mode. It encodes everything a URL cannot carry raw, including &, =, ? and /. Full URL mode is for repairing a whole address and deliberately leaves those structural characters alone.

Is %20 or + correct for a space? In query strings produced by form submissions, + means a space. This tool uses %20, which is valid everywhere in a URL, to avoid ambiguity.

What if the link still fails after I encode the value? Check that you encoded the value only, not the whole address, and that the value was not already encoded once: encoding an encoded value again turns % into %25 and breaks it a second time. Encoding also cannot repair a wrong domain, path or parameter name.

Conclusion

Most broken links are good addresses carrying one value that was never encoded. Diagnose by splitting the link at its punctuation, encode the offending value in Component mode with the URL Encoder/Decoder, and rebuild. The better habit is to avoid the repair entirely by encoding values correctly when you build a query string in the first place, which is the subject of How to Encode Query String Parameters Safely. For more tools like these, see the Developer Tools guide archive.