How to use it
- Choose Encode, Decode or Parse a URL, then type or paste into the input box. The result updates as you type.
- When encoding, pick a value or query parameter to escape everything that is not a plain letter, digit or one of
- _ . ! ~ * ' ( ), or a whole URL to keep characters such as: / ? # & =that give the address its structure. - When decoding, turn on Treat + as a space for text taken from an HTML form or a query string, where a plus means a space.
- To take an address apart, choose Parse a URL and paste a full address that starts with
http://orhttps://. You get each part and a table of the query parameters, with names and values already decoded.
What URL encoding is
A web address can only contain a limited set of characters. Everything else, such as spaces, accented letters, emoji or an ampersand inside a value, is written as a percent sign followed by two hexadecimal digits for each byte of its UTF-8 form: a space becomes %20 and “é” becomes %C3%A9. This is called percent-encoding.
The two encoding modes match the two functions built into JavaScript. encodeURIComponent escapes nearly everything and is the right choice for one value, such as the text after q=. encodeURI leaves the characters that structure a URL alone, so it is for a complete address that only needs its unusual characters escaped. Encoding a whole address with the component mode would also escape the slashes and colons and break it.
Reading query parameters
Everything after the ? and before any # is the query string: pairs of name=value joined by &. The parser lists them in order, and keeps repeated names (such as tag=a&tag=b) as separate rows. To read these values in PHP, see how to get a parameter from a URL in PHP.
Related guides
More developer tools: Base64 encoder and decoder, regex tester and JWT decoder.
Frequently asked questions
No. Encoding, decoding and parsing are done by your browser’s own JavaScript. Nothing is sent to CodeROG or anyone else.
encodeURIComponent escapes every character that has a special meaning in a URL, so it is for a single value. encodeURI keeps those characters so that a full address stays usable.
A percent sign must be followed by two hexadecimal digits, and the bytes must make valid UTF-8. A stray % or a sequence such as %E9 on its own (an old Latin-1 byte) cannot be decoded.
Percent-encoding always uses %20. The plus sign is a convention of HTML forms and query strings only. This tool encodes spaces as %20, and can read + as a space when decoding if you ask it to.
Yes. Without a scheme there is no way to tell a host from a path, so the parser asks for a full address such as https://example.com/page?id=1.