Passing a URL as a query parameter
A return_to or redirect_uri value must be component-encoded, otherwise its own query string merges into the outer one. The symptom is a redirect that loses everything after the first '&'.
Percent-encodes (RFC 3986) or decodes query parameters, URI path segments, and form components for safe HTTP transport.
—Percent-encodes (RFC 3986) or decodes query parameters, URI path segments, and form components for safe HTTP transport.
a b&c=d
a%20b%26c%3Dd
Spaces become %20, & becomes %26.
Encoded text is safe inside URLs; decoded text is human-readable.
Your input is processed entirely in your browser and never sent to a YAS server.
curl -X POST "https://yas.sh/api/v1/tools/url-encoder" \
-H "Content-Type: application/json" \
-d '{"input":"a b&c=d","mode":"encode"}'const res = await fetch("https://yas.sh/api/v1/tools/url-encoder", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
"input": "a b&c=d",
"mode": "encode"
}),
});
const data = await res.json();import requests
r = requests.post("https://yas.sh/api/v1/tools/url-encoder", json={"input":"a b&c=d","mode":"encode"})
data = r.json()| Field | Type | Required | Description |
|---|---|---|---|
| input | string | Yes | Text or URL fragment |
| mode | "encode" | "decode" | No (default "encode") | Direction |
{ "slug": "url-encoder", "result": "a%20b%26c%3Dd", "mode": "encode" }Percent-encode / percent-decode a string.
400 VALIDATION_ERROR — invalid input or unsupported option.413 PAYLOAD_TOO_LARGE — input exceeds the 64 KB limit.429 RATE_LIMIT_EXCEEDED — rate limit exceeded (60 req/min).Percent-encoding replaces a byte with '%' followed by its two-digit hexadecimal value, as defined in RFC 3986. Characters are first encoded to UTF-8, so a space becomes %20 and 'é' becomes %C3%A9. Only unreserved characters — A–Z, a–z, 0–9, hyphen, period, underscore and tilde — are guaranteed to pass through unchanged.
The critical distinction is between encodeURI and encodeURIComponent. encodeURI preserves the reserved characters that give a URL its structure (: / ? # [ ] @ ! $ & ' ( ) * + , ; =) and is for encoding a whole URL. encodeURIComponent encodes those too and is for a single value going into a path segment or query parameter. Using the wrong one is why an encoded URL passed as a redirect parameter arrives truncated at the first ampersand.
Query strings add a historical quirk: application/x-www-form-urlencoded encodes a space as '+', while RFC 3986 percent-encoding uses %20. Both appear in the wild, and a decoder that does not know which convention produced the string will render '+' literally or turn a real plus sign into a space.
A return_to or redirect_uri value must be component-encoded, otherwise its own query string merges into the outer one. The symptom is a redirect that loses everything after the first '&'.
User-supplied text containing '#', '&' or '/' breaks an unencoded link. Encoding the value keeps the fragment and parameter boundaries intact regardless of what the user typed.
Decoding turns %3A%2F%2F back into :// so you can see the actual destination. Watch for double encoding, where %253A indicates the value was encoded twice along the way.
Path segments with non-ASCII characters are UTF-8 percent-encoded, but the host label is not — internationalised domains use Punycode (xn--) instead, which is a separate transformation.
What this tool deliberately does not do, and where it will disagree with other implementations.