Home / Free tools / Text & Data / URL Encode and Decode
URL Encode and Decode
Encode or decode text for use in web addresses, in the mode you need. Paste a full link to see its host, path and query parameters. Nothing leaves your browser.
Runs in your browser. Nothing you paste or choose is uploaded or stored.
What this URL encoder and decoder does
A web address can only contain a limited set of characters. Spaces, accented letters, emoji and symbols such as ampersand or percent have to be written as a percent sign followed by two hexadecimal digits, so a space becomes %20 and the Polish letter "ż" becomes %C5%BC. This tool converts text to that form and back, in three modes, and when you decode a complete address it also splits it into its parts so you can read the query parameters one by one.
The process is called percent-encoding and is defined in RFC 3986. Every character that is not allowed is first turned into bytes using UTF-8, and each byte is written as % plus its value in hexadecimal. Letters, digits and the four characters hyphen, period, underscore and tilde are never encoded.
Which mode to use
- Component is what you want for a single value that you are about to put into an address, such as a search term or a campaign name. It encodes every character that has a special meaning in a URL, including
/ ? # & = : +and the space. This is the same result as the JavaScript functionencodeURIComponent. - Whole address is for a complete URL that already has its structure. It leaves
: / ? # @ ! $ & ' ( ) * + , ; =alone and only encodes what is not allowed anywhere, such as spaces and non-English letters. It matchesencodeURI. Do not use it on a single value that contains an ampersand, or the ampersand will be read as a separator. - Form data follows the older
application/x-www-form-urlencodedrules that HTML forms use: the space is written as a plus sign, and a few more characters are encoded. When you decode in this mode, plus signs turn back into spaces.
Worked example
Load the example, the text name=Zażółć & Co/size=10%. In component mode the result is name%3DZa%C5%BC%C3%B3%C5%82%C4%87%20%26%20Co%2Fsize%3D10%25. You can see each rule at work: the equals signs became %3D, the ampersand %26, the slash %2F, the space %20, the percent sign itself %25, and each Polish letter became two bytes. In form mode the same text gives the same string except that the spaces are written as plus signs: ...Za%C5%BC%C3%B3%C5%82%C4%87+%26+Co.... In whole-address mode, https://example.com/a b?q=zażółć becomes https://example.com/a%20b?q=za%C5%BC%C3%B3%C5%82%C4%87 and the colon, slashes and question mark are untouched.
Mistakes this tool helps you avoid
- Double encoding. Encoding text that is already encoded turns
%20into%2520. If you see%25in an address where you expected a space, something has been encoded twice. Decode once, check, and decode again if needed. - Encoding the whole address in component mode. The result,
https%3A%2F%2F..., is correct only when the address is itself a value inside another address, such as a redirect parameter. - Plus versus %20. A plus sign means a space only in form data. In a path it is a literal plus, so decoding a path in form mode corrupts it.
- Bad percent sequences. A lone
%or one followed by non-hex characters cannot be decoded, and the tool tells you instead of guessing.
Reading an address in parts
When the decoded or encoded text is a full address, the tool lists its scheme, host, path, query parameters and fragment. That makes long tracking links readable: you can see which utm_ parameters are set and which are missing. To build such links correctly from the start, use the UTM link builder; to turn a finished link into a scannable code, use the QR code generator.
Related tools
Hiding data in a text-safe form for use inside a URL is the job of the Base64 tool, and the JSON formatter tidies a document before you encode it. All of them run in your browser; nothing you type is uploaded or stored. More are on the Text and data page.
Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for a complete address and leaves the characters that give a URL its structure alone. encodeURIComponent is for one value and also encodes slash, question mark, ampersand, equals and similar characters. This tool offers both as Whole address and Component.
Why does a space sometimes appear as + and sometimes as %20?
%20 is the standard percent-encoding of a space. The plus sign is a convention of HTML form submissions, used in query strings. Outside a query string a plus is just a plus.
What is double encoding and how do I spot it?
It happens when already encoded text is encoded again, so %20 becomes %2520. If a decoded address still contains percent sequences, it was probably encoded twice.
Does it handle non-English characters and emoji?
Yes. Characters are converted to UTF-8 bytes and each byte is written as a percent sequence, so Polish letters, Chinese characters and emoji round-trip correctly.
Why does decoding fail with a malformed sequence error?
The text contains a percent sign that is not followed by two hexadecimal digits, or a sequence of bytes that is not valid UTF-8. Fix or remove the bad part and try again.
Which characters are never encoded?
Letters A to Z and a to z, digits 0 to 9, and hyphen, period, underscore and tilde are always left alone. Component mode also leaves ! * ' ( ) as they are, matching the browser function, while form mode encodes them.
Is the text I paste uploaded?
No. Encoding and decoding run in your browser and nothing is sent or stored.
Google, Merchant Center, YouTube, LinkedIn, Indeed, Glassdoor and Shopify are trademarks of their owners. Van Born Labs is independent and not affiliated with them. Google's own help pages are the final word on its rules.