Encode full URLs, decode callback links, and escape query parameter values without losing the structure of the original request.
Encoding redirect_uri or callback values? Use the guide for component-level rules, then return here to encode or decode the exact value.
URL encoding, also known as percent-encoding, converts spaces, unicode, and reserved characters into a transport-safe format. Use it when a browser URL, redirect_uri, API query value, or copied callback link must survive transit without changing meaning.
Use full-URL encoding when you want to keep separators like :, /, ?, &, and = readable inside one complete link. Use component encoding when a single value must live inside a query parameter, redirect target, or nested callback URL.
redirect_uri=https://app.example.com/callback?next=/settings
redirect_uri=https%3A%2F%2Fapp.example.com%2Fcallback%3Fnext%3D%2Fsettings
https://app.example.com/callback?next=%2Fsettings%3Ftab%3Dprofile
https://app.example.com/callback?next=/settings?tab=profile
email=dev+alerts@example.com
email=dev%2Balerts%40example.com
Encode a full URL when you want one complete link to stay readable and keep separators like ?, &, and = intact. Encode one parameter value when the data must fit inside a single key=value pair such as redirect_uri, state, or a search query.
encodeURI preserves structural URL characters like :, /, ?, and # for a complete link. encodeURIComponent escapes those reserved characters too, which makes it the safer choice for query parameter values, nested URLs, and copied callback targets.