URL Encoder / Decoder
Percent-encode text for URLs and decode %20-style codes back to text. Encode one query value, a whole URL or form data, and take any URL apart into its parts.
How to Use
- Choose Encode (text → %XX codes) or Decode (%XX codes → text).
- Pick what you are encoding: One value (a query parameter or path segment), a Whole URL, or Form data (spaces as +).
- Type or paste into the input box. The result updates as you type.
- Paste a full URL to see it taken apart, with every query parameter decoded.
- Press Copy for the result, or Swap to send it back the other way.
Worked Example
Encode the search “fish & chips” as a query value.
Letters stay as they are. The space is byte 0x20, so it becomes %20. “&” is byte 0x26, so it becomes %26.
Result: fish%20%26%20chips, and the URL is ?q=fish%20%26%20chips. Without encoding, ?q=fish & chips would end the value at the &.
Encode “Café”. “é” is U+00E9, which is two bytes in UTF-8: C3 A9. Each byte gets its own code: Caf%C3%A9. A Chinese or Japanese character is three bytes, so “日” becomes nine characters: %E6%97%A5.
Show Work
Formulas
Why URLs Need Encoding
The first URL specification (RFC 1738, 1994) allowed only a limited set of ASCII characters, because URLs had to survive email, printed pages and old networking software. Characters with special jobs — / to separate path segments, ? to start the query, & and = to separate parameters, # for the fragment — must be encoded whenever they are data rather than structure.
RFC 3986 (2005) is the current definition. It says non-ASCII text should be converted to UTF-8 and each byte percent-encoded, which is why accented letters and other alphabets take two to four codes each. HTML forms kept an older convention from the early web: in submitted form data, a space is written as +.
About This Tool
This tool percent-encodes and decodes text the way browsers and servers do, in three styles: a single value (JavaScript’s encodeURIComponent), a whole URL (encodeURI), and HTML form data with + for spaces. A strict mode also encodes the five characters JavaScript leaves alone, as signed API requests require.
Decoding is forgiving: a stray or broken % code is pointed out instead of throwing the whole text away, and a result that still contains codes is flagged as possible double encoding. Paste a full URL and it is taken apart into scheme, host, path, query parameters and fragment, each decoded. Everything runs in your browser.
Related tools: Base64 Encoder / Decoder, HTML Entity Encoder, and Unicode Lab.
Frequently Asked Questions
What is URL encoding (percent-encoding)?
URLs can only contain a small set of ASCII characters. Anything else is written as % followed by two hex digits for each byte of its UTF-8 form: a space is %20, “&” is %26 and “é” (bytes C3 A9) is %C3%A9. Decoding reverses it.
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent (“One value” here) encodes everything that could change the meaning of a URL, including / ? # & = — use it for a single query value or path segment. encodeURI (“Whole URL”) leaves those characters alone so a complete URL keeps working, and only encodes spaces, non-ASCII letters and a few others.
Should a space be %20 or +?
Both appear. %20 is the URL standard and is always safe. + means a space only in form data (application/x-www-form-urlencoded) — the query strings that HTML forms submit. In a path, + is a literal plus sign. Choose “Form data” to encode spaces as + and to decode + back to spaces.
Why do I see %2520 in a URL?
It has been encoded twice. %20 was encoded again, and its % became %25. Decode once to get %20, and again to get the space. This tool warns you when a decoded result still contains percent codes.
Which characters never need encoding?
The unreserved characters of RFC 3986: A–Z, a–z, 0–9 and - _ . ~ are always safe as they are. JavaScript’s encodeURIComponent also leaves ! ' ( ) * unencoded; tick “Strict RFC 3986” to encode those as well.
How do I use the URL Encoder / Decoder?
Just type or paste your value. The answer shows up right away — there is no button to press. Change anything and it updates by itself.
Do I need to install or sign up for anything?
Not at all — it runs in the browser with nothing to install and no account. After it loads once, it even works without an internet connection.
Is my information private?
Yes. Everything happens in your browser. Nothing you type is sent to a server or saved anywhere.
Common Use Cases
Building a query string
Searching for “fish & chips” needs ?q=fish%20%26%20chips — without the %26, the server would read “ chips” as a separate parameter.
Reading a tracking link
Paste a long marketing or redirect URL to see its utm_ parameters and the real destination, decoded from %3A%2F%2F back to ://.
Non-English URLs
The page /wiki/Café travels as /wiki/Caf%C3%A9. Decode it to read the real path, or encode a name before putting it in a link.
API requests
Signed API requests (OAuth 1.0, AWS) need strict RFC 3986 encoding, where ! ' ( ) * are encoded too — otherwise the signature does not match.
Debugging double encoding
A file name that shows up as my%2520file.pdf was encoded twice; decoding twice gives “my file.pdf”.
Last updated: