Component or whole URL
This is the only decision that matters here, and getting it wrong is the reason encoded links break.
Component is for one piece: a search term, a parameter value, a filename. It escapes everything that has structural meaning, including & = ? / #. A value containing & must be encoded this way, or it will be read as the start of the next parameter.
Whole URL is for a complete address. It escapes spaces and non-ASCII characters but leaves the delimiters intact, so the address stays an address.
A quick test: if what you have would sit to the right of an = in a query string, use component. If you would paste it into the address bar, use whole URL.
The space problem
A space can appear as %20 or as +, and they are not interchangeable.
%20 is valid anywhere in a URL. + means a space only inside a query string, under the form-encoding rules, and in a path it is a literal plus character. That is why a filename with a plus in it sometimes arrives with the plus turned into a space: something applied form decoding to a path.
When in doubt, %20 is the safe choice.
Reading a query string
When the input is a full URL, its parameters are listed underneath, decoded. This is usually the real question behind “decode this URL”: not the whole string, but what one tracking parameter or redirect target actually contains.
Why this is not encryption
Percent-encoding is a transport convention, not a secret. Anyone can decode it instantly, and search engines, proxies and server logs all record the decoded form. A token in a query string is a token in plain sight, which is why credentials belong in a header or a request body, not in a URL.
Questions
What is the difference between the two scopes?
Component encoding escapes the delimiters too, so `&`, `=`, `?`, `/` and `#` become percent sequences. Whole-URL encoding leaves them alone because they are structure. Use component for a single parameter value, whole URL for an address.
Why did my URL break after encoding?
Almost always the wrong scope: encoding a whole address as a component turns its slashes and question mark into text, so it stops being a URL.
What is %20 versus +?
Both mean a space, in different places. `%20` is correct everywhere; `+` means a space only inside a query string, in the form-encoding scheme. In a path, `+` is a literal plus.
Why does decoding fail with a valid-looking string?
A lone `%` that is not followed by two hexadecimal digits is not valid percent-encoding. A raw percent sign in text must itself be written `%25`.
Is the URL sent anywhere?
No. Encoding and decoding use the browser's own functions, and the query breakdown is computed locally.