URL Encoder & Decoder
Paste text or a whole address and instantly see the encoded or readable version. It helps with links containing spaces, accented letters or the & sign, with API parameters and with untangling long URLs.
How URL encoding works
A URL is not an ordinary sentence. Some characters have their own meaning in it: the question mark starts the parameters, the & sign separates them and the hash points to a place on the page. Spaces and accented letters should not be written into an address directly. URL encoding, also called percent-encoding, therefore replaces such characters with a % sign and two hexadecimal digits. A space becomes %20, the & sign becomes %26 and the letter é becomes %C3%A9, because it takes two bytes in UTF-8.
When a URL encoder helps
- when you build a link with a search phrase or a filter
- when a parameter contains a space, an accented letter, an & sign or a question mark
- when you want to untangle a long URL from an email, an ad or a search engine
- when you prepare values for an API, a form or a query string
- when you are figuring out why a link broke after pasting it
Examples
This is how common text looks before and after encoding:
coffee & tea
coffee%20%26%20tea
café crème
caf%C3%A9%20cr%C3%A8me
1+1=2
1%2B1%3D2
https://example.com/price list?q=café
https://example.com/price%20list?q=caf%C3%A9
A whole address or just part of it
When you paste a whole address starting with https://, the encoder keeps its structure and only encodes spaces, accented letters and other characters that are not allowed. If you paste only a value, such as a search phrase, it also encodes &, ?, / and =, so the browser does not treat them as part of the address. Encode a parameter value on its own and only then put it into the link.
A space as %20 or +
Spaces are written in URLs in two ways. The standard uses %20, but forms and search engines such as Google use + in parameters. The encoder always writes a space as %20, which every server understands. When decoding, it reads + in parameters as a space and recognises a real plus sign by its encoded form %2B.
Related Tools
More tools for preparing, editing, and checking text.
FAQ
What is URL encoding?
%20, the & sign becomes %26 and accented letters become a pair of such codes, for example é becomes %C3%A9.
Why is a space sometimes %20 and sometimes +?
%20 is the form defined by the URL standard and works everywhere. HTML forms and search engines use + for a space, but only in parameters after the question mark. This encoder therefore writes a space as %20 and understands both forms when decoding.
Can I encode a whole URL?
https://, the tool recognises it and keeps characters such as /, ?, & and =, so the link keeps working. It only encodes spaces, accented letters and other characters that are not allowed. To use a whole address as a parameter value, for example in a redirect, click Encode as a parameter value below the result.
Why do I get an error when decoding?
% sign must be followed by two hexadecimal digits, that is 0 to 9 or A to F. An incompletely copied address causes an error too, for example when only %C3 is left of %C3%A9. If the text should contain a percent sign itself, it has to be encoded as %25.
Does the result match PHP or JavaScript?
rawurlencode. The JavaScript function encodeURIComponent leaves ! ' ( ) * unchanged, while this tool encodes them as well, which OAuth signatures require, for example. When decoding, it behaves like PHP's urldecode and reads + as a space.