URL Encoder & Decoder
Convert characters that are not URL-safe to and from percent-encoded form. Runs locally in your browser.
What this tool does
Percent-encoding (also called URL-encoding) replaces characters that have special meaning in
URLs, or that are not allowed at all, with a percent sign followed by the character's
hexadecimal value. A space becomes %20, an ampersand becomes %26,
a question mark becomes %3F. This tool runs both directions: encode plain text
so it can sit safely inside a URL, or decode an encoded string back to readable text.
Everything happens in your browser. Your input is never uploaded or logged.
How to use it
Paste your text into the input box. Press Encode to convert plain text into
percent-encoded form, or Decode to reverse the process. The
Component mode checkbox controls whether characters like / and
? get encoded too. Leave it on when encoding a single query parameter or path
segment. Turn it off when encoding an entire URL that already contains structural characters.
Example: encoding hello world & friends? in component mode produces
hello%20world%20%26%20friends%3F.
Common use cases
- Pasting a search query, file name, or arbitrary text into a URL parameter without breaking the URL.
- Decoding a copied URL to read what a parameter actually contains.
- Building API request URLs by hand for testing.
- Debugging double-encoded strings (encoded twice, showing things like
%2520). - Translating between human-readable text and the form a redirect or tracking URL uses.
Common pitfalls
- Encoding the whole URL with component mode on. If you encode
https://example.com/path?q=helloin component mode, you also encode the:,/, and?. Use component mode only on individual parameter values, not full URLs. - Plus signs in query strings. Some servers treat
+in a query string as a literal space. Percent-encoded%20is always a space and is safer. - Already-encoded input. Encoding an already-encoded string produces
double-encoded output (the
%itself becomes%25). Decode first, check, then re-encode if needed.
Frequently asked questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI is for entire URLs and leaves structural characters like /, ?, &, and # alone. encodeURIComponent is for single parameter values and encodes those structural characters too. The Component-mode checkbox on this tool toggles between them. Use Component mode for individual query parameter values; turn it off when encoding a full URL.
- Why does a space become %20 instead of +?
- In standard URL encoding, a space is %20. Some legacy contexts (specifically the application/x-www-form-urlencoded body of an HTML form) use + for a space. Modern URLs use %20 in both query and path. If you see + in a query string, it usually means the value came through a form encoder; treat it as a space when decoding.
- What characters need to be URL-encoded?
- Reserved characters with special meaning in URLs (like ? & = / # %) must be encoded when they appear in a value rather than as structure. Non-ASCII characters (accents, emoji, non-Latin scripts) are also encoded. Letters, digits, and a small set of unreserved punctuation (- _ . ~) pass through unchanged.
- What is double-encoding and how do I spot it?
- Double-encoding happens when an already-encoded string gets encoded again. The percent sign itself becomes %25, so an originally-encoded space (%20) becomes %2520. If you see %25 followed by hex digits, the input was likely already encoded once. Decode first, verify, then re-encode if needed.
- Is the URL I paste here sent anywhere?
- No. The tool runs entirely in your browser. Your input is never uploaded.
- How do I encode a URL that contains a hash fragment?
- Encode the value but not the hash mark itself when it acts as a fragment separator. Use Component mode on the value, then prepend it with the unencoded #. If the # appears inside a parameter value rather than as a fragment, encode it as %23.
Cite this tool
For academic, journalistic, or technical references. Pick a format:
Citations use 2026 as the publication year. Access date is left as a fillable placeholder where the citation style expects one.