URL Encoder and Decoder
Free URL encoder and decoder. Percent-encode query parameters or full URLs, decode %XX sequences and handle + as space. Runs in your browser.
How to use the URL encoder and decoder
- Choose Encode to convert text into a URL-safe form, or Decode to turn percent-encoded text back into readable characters.
- When encoding, pick a mode: Component for a single value (such as a query parameter or a path segment), or Full URL to encode a complete address while keeping its structure intact.
- When decoding data that comes from an HTML form or a query string, enable Treat + as space so that
+signs become spaces. - Paste your text and copy the result. If a percent sequence is malformed, the tool reports an error instead of guessing.
What is URL encoding?
URLs may only contain a limited set of ASCII characters. Some characters, such as /, ?, #, & and =, are reserved because they separate the parts of an address: the path, the query string and the fragment. Others, such as spaces, quotes, accented letters or emoji, are simply not allowed. URL encoding, also called percent-encoding, solves both problems by replacing each problematic byte with a % followed by two hexadecimal digits.
Text is first converted to UTF-8 bytes, and each byte is encoded separately. A space becomes %20, an ampersand becomes %26, é (two bytes in UTF-8) becomes %C3%A9, and the emoji 😀 (four bytes) becomes %F0%9F%98%80. Unreserved characters, meaning letters, digits and - _ . ~, never need encoding.
Component mode vs. full URL mode
Choosing the right mode is the most important decision, and getting it wrong is a classic source of bugs.
Component mode works like JavaScript’s encodeURIComponent. It encodes every reserved character, so the result can be safely placed inside one part of a URL. Use it for query parameter values, path segments or anything a user typed. For example, the search term rock & roll becomes rock%20%26%20roll. If you did not encode the &, the server would read roll as the start of a new parameter.
Full URL mode works like encodeURI. It assumes the input is already a complete address and preserves the characters that give it structure, such as : / ? # & and =, while encoding spaces and non-ASCII characters. Use it to clean up an address such as https://example.com/café menu?q=tea into https://example.com/caf%C3%A9%20menu?q=tea. Do not use it on individual values: an & inside a value would stay unencoded and break the query string.
A good rule of thumb: build URLs from parts, encode each value in component mode, and only use full URL mode for addresses you receive already assembled.
The + sign and form encoding
HTML forms submitted with application/x-www-form-urlencoded encode spaces as + instead of %20. That is why search URLs often look like ?q=hello+world. Standard percent-decoding leaves + unchanged, because in a path a plus is just a plus. When you decode a query string or form data, turn on Treat + as space to get hello world. Leave it off for paths and for values where a literal + matters, such as phone numbers or Base64 data. A real plus sign in form data is sent as %2B, so it is decoded correctly either way.
Privacy
Encoding and decoding run entirely in your browser. Nothing you paste, including URLs that may contain tokens, session IDs or personal data, is sent to a server or stored.
Frequently asked questions
Why does decoding fail with a "malformed" error?
A % must be followed by exactly two hexadecimal digits, and the resulting bytes must form valid UTF-8. Strings such as 100%, %G1 or a truncated sequence like %E2%82 cannot be decoded reliably, so the tool reports the problem instead of producing incorrect text. To include a literal percent sign, encode it as %25.
What is the difference between %20 and +?
Both can represent a space, but in different contexts. %20 is valid everywhere in a URL. + means a space only in form-encoded query strings; elsewhere it is a literal plus sign.
Should I encode an entire URL in component mode?
Only if the whole URL is itself a value inside another URL, for example a redirect= parameter. In that case, component mode is exactly right: https://a.com/?x=1 becomes https%3A%2F%2Fa.com%2F%3Fx%3D1.
Why is my text encoded twice?
Double encoding happens when already-encoded text is encoded again, turning %20 into %2520. Decode once to check, and make sure each value is encoded only at the moment it is inserted into the URL.
Does URL encoding hide or protect data?
No. Percent-encoding is fully reversible and provides no security. Sensitive values in URLs can end up in browser history and server logs, so avoid putting secrets in URLs at all.
Related tools
- Base64 Encoder and Decoder Free Base64 encoder and decoder with full UTF-8 support and a URL-safe base64url option. Runs entirely in your browser, nothing is uploaded.
- JSON Formatter and Validator Free JSON formatter and validator that beautifies, minifies and checks JSON in your browser, with syntax errors reported by line and column.