99tools

URL Parser & Query Editor

runs in your browser

Split a URL into scheme, host, port, path, query and fragment; edit the query as a table and rebuild the address, with + or %20 encoding as you choose.

Spaces as

Paste a URL, or just a query string. Edit the parameters below and the address is rebuilt as you type.

URL

Rebuilt

about this tool

Parsing

The URL is parsed by the browser's own URL class, which implements the WHATWG URL Standard — the same parser behind the address bar. That is why a few things change the moment you paste: the scheme and host are lowercased, /a/./b/../c becomes /a/c, a space in the path becomes %20, a default port (443 for https, 80 for http) is dropped, and an internationalised host is converted to punycode. None of these alter where the URL points; they are the canonical form every browser would send.

An address without a scheme, such as example.com/path, is read as https:// and a note under the output says so. A query string on its own — ?a=1&b=2, or just a=1&b=2 — is accepted too, and the tool shows only the query editor.

The query string

The query is taken apart here rather than by URLSearchParams, for one reason: URLSearchParams cannot tell ?flag from ?flag=. This tool keeps a bare key bare until you type a value, so a URL you have not edited comes back exactly as you pasted it. Order and duplicates are preserved; ?q=a&q=b stays two parameters, and a second = inside a value stays inside the value.

A + in the query is read as a space, because that is what form encoding means by it, and a note says so when it happens; %2B is a literal plus. A percent sign not followed by two hex digits cannot be decoded and is shown as written, with a note, rather than failing the whole URL.

Rebuilding

Edit keys and values in the table, add or remove rows, or sort by key (a stable sort, so duplicates keep their order), and the address is rebuilt with only the query replaced. How values are encoded is your choice:

  • + (form) is application/x-www-form-urlencoded, what HTML forms and URLSearchParams produce: a space is +, and ~ becomes %7E.
  • %20 (RFC 3986) is what most APIs and URL-signing schemes expect: a space is %20, ~ is left alone, and ! * ' ( ) are encoded too.

The two disagree in exactly the places people get bitten, which is why the choice is on the page rather than buried.

Limits

Only the query is editable in the table; change the path, host or fragment in the URL itself. Relative URLs are not resolved against a base, since there is none to resolve against. Schemes without an authority (mailto:, data:) parse, but their "path" is whatever follows the colon and the origin is empty, which is what the standard says.

questions

Should a space be a plus or %20?
Both are valid, in different places. HTML forms and URLSearchParams write a space as "+" (form encoding); most APIs, signed URLs and anything following RFC 3986 expect "%20" and treat "+" as a literal plus. Pick the one the receiving end reads. The default here is form encoding, because a URL pasted from a browser comes back unchanged.
Why did the port disappear?
The browser’s URL parser drops a port that is the scheme’s default: 443 for https, 80 for http. The Port field still shows which port applies, marked "default", so nothing is hidden.
What is the difference between "?flag" and "?flag="?
To most servers nothing, but they are different strings, and some frameworks distinguish a present-but-empty parameter from a bare one. The tool keeps a bare key bare until you type a value, so rebuilding a URL you have not edited gives you exactly what you pasted.
Why did my host turn into xn--something?
That is punycode, the ASCII form of an internationalised domain name. A browser converts "münchen.de" to "xn--mnchen-3ya.de" before it ever looks the name up, so that is the host the URL really has. The tool says so when it happens.
Can I edit the path or the host too?
Not in the table; edit them in the URL itself and the parts and query update. The table is for the query string, which is where URLs are usually assembled and where hand-editing goes wrong.