What is this calculator for?
You need to put a search query "best espresso machines under $500" into a URL parameter. Or you're debugging a broken link with strange %20 codes. The URL encoder converts characters that have special meaning in URLs (spaces, ampersands, quotes, slashes) to their percent-encoded equivalents (%20, %26, %22, %2F), and decodes them back. Essential for any web work with query strings, form submissions, or API calls.
URL encoding (also called percent-encoding) is defined in RFC 3986. The standard reserves certain characters for URL structure: / separates path segments, ? introduces query string, & separates parameters, = separates key from value, # introduces fragment. To include these characters in actual content (not as URL structure), they're percent-encoded: space → %20, & → %26, ? → %3F, / → %2F. Letters and digits aren't encoded; some symbols (-, _, .) are also safe.
This tool encodes plain text to URL-safe form and decodes URL-encoded text back. Use for: building URL parameters programmatically, debugging URLs with encoded characters, copying complex search URLs.
How to use this calculator
For encoding: paste text. The tool outputs URL-encoded version. "Hello World!" → "Hello%20World%21". "search query?" → "search%20query%3F".
For decoding: paste URL-encoded text. The tool outputs the original. "best%20espresso%20%24500" → "best espresso $500".
For full-URL encoding: some encoders encode just the path portion or just the query string; others encode the entire URL. For most uses: encode each parameter value separately, then assemble the URL. Don't encode the URL structure itself (the ?, &, = separating parts of the query string).
Understanding your results
The encoder outputs URL-safe text; the decoder outputs original text from percent-encoded input.
Common percent-encoded characters:
Space → %20 (or + in form-encoded variant).
! → %21. " → %22. # → %23. $ → %24. % → %25. & → %26. ' → %27. ( → %28. ) → %29. * → %2A. + → %2B. , → %2C. / → %2F. : → %3A. ; → %3B. < → %3C. = → %3D. > → %3E. ? → %3F. @ → %40.
Non-ASCII characters (é, 中, etc.) get encoded as UTF-8 multi-byte sequences. é → %C3%A9 (2 bytes UTF-8). 中 → %E4%B8%AD (3 bytes UTF-8). This makes URLs with non-Latin characters very long; some browsers display them in original form but transmit them percent-encoded.
The %20 vs + space confusion. Two ways to encode spaces in URLs. %20: the canonical RFC 3986 way; works in any URL part. +: a shortcut for spaces specifically in form-encoded query strings (Content-Type: application/x-www-form-urlencoded). So a search URL might be: ?q=best+espresso or ?q=best%20espresso — both work for most browsers, but they're technically different. In URL path components: use %20. In query string of form submissions: + is common but %20 also works.
URL length limits. RFC 3986 doesn't specify a maximum URL length. Browsers and servers impose limits: 2,083 chars (Internet Explorer historical), 8,192 chars (most modern browsers and servers), 16,000+ chars (some modern setups). For practical purposes, keep URLs under 2,000 characters; longer URLs may be truncated by some software or rejected by some servers. For very long data: POST request body instead of GET URL parameters.
Double-encoding bugs. Encoding an already-encoded URL produces garbled output. "%20" encoded again becomes "%2520" (% becomes %25, then 20 stays). Decoders that decode once won't recover the original. Always know whether your input is already encoded; encode only raw text, not already-encoded text.
A worked example
A developer is building a search feature that constructs URLs to Google. User searches for "best espresso machine under $500 & quiet".
Naive URL construction: https://google.com/search?q=best espresso machine under $500 & quiet — broken because the & introduces a new parameter (Google would see q=best espresso machine under $500 AND a separate empty parameter "quiet").
Correct construction with URL-encoded query value: https://google.com/search?q=best%20espresso%20machine%20under%20%24500%20%26%20quiet
Now the entire search string is one URL-encoded value of the q parameter. Google receives the literal search string with all characters intact.
JavaScript code: const url = 'https://google.com/search?q=' + encodeURIComponent(searchString). The encodeURIComponent() function handles all the encoding automatically. Use this for query parameter values; use encodeURI() for full URLs (doesn't encode ?, &, etc.).
Variation: she's debugging a broken URL in production. Browser address bar shows: https://example.com/search?q=jos%C3%A9. Decoding the q parameter: %C3%A9 is é (UTF-8 encoded). So the search was for "josé" — the URL is correct; it's just showing the Spanish accent properly encoded. Common confusion when developers see non-ASCII characters as percent-encoded; they're encoded, not broken.
Related resources
For other encoding/decoding tools, see Base64 and Hash Generator. For JSON in URLs (often requires URL-encoding the JSON), the JSON Formatter. For text manipulation, the Case Converter. The RFC 3986 is the authoritative IETF specification for URI generic syntax; WHATWG URL Standard covers modern browser URL handling.