URL Parser / Query String Splitter
This simple tool lets you parse a URL into its individual components, i.e scheme, protocol, username, password, hostname, port, domain, subdomain, tld, path, query string, hash, etc. It also splits the query string into a human readable format and takes of decoding the parameters.
This tool uses the URI.js library developed by Rodney Rhem
To learn more about the structure of a URL, check out the URLs Explained section of this page.
URLs Explained
What's a URI?
Uniform Resource Identifiers (URIs) are used to identify 'names' or 'resources'. They come in 2 varieties: URNs and URLs. In fact, a URI can be both a name and a locator!
What's a URL?
Uniform Resource Locators (URLs) provide a way to locate a resource using a specific scheme, most often but not limited to HTTP. Just think of a URL as an address to a resource, and the scheme as a specification of how to get there.
What's a URN?
Uniform Resource Names are identifiers for resources. They are location independent and make use of the urn: scheme.
What's the syntax of a URI?
scheme:scheme-specific-part?query#fragment
Examples:
- ftp://ftp.is.co.za/rfc/rfc1808.txt
- http://www.ietf.org/rfc/rfc2396.txt
- ldap://[2001:db8::7]/c=GB?objectClass?one
- news:comp.infosystems.www.servers.unix
- tel:+1-816-555-1212
- telnet://192.0.2.16:80/
- urn:oasis:names:specification:docbook:dtd:xml:4.1.2
What's the syntax of a URL?
scheme://username:[email protected]:port/path/file-name.suffix?query-string#hash
Examples:
- http://www.google.com
- http://foo:[email protected]/very/long/path.html?p1=v1&p2=v2#more-details
- https://secured.com:443
- ftp://ftp.bogus.com/~some/path/to/a/file.txt
What's the syntax of a URN?
urn:namespame-identifier:namespace-specific-string
Examples from Wikipedia:
- urn:isbn:0451450523
- urn:ietf:rfc:2648
- urn:uuid:6e8bc430-9c3a-11d9-9669-0800200c9a66
What's the 'userinfo' in a URL?
The userinfo part of a URL is made of the username and/or the password. They are optional and used for authentication purposes. The userinfo has the format username:password and is followed by the @ character and the host. The password is optional, often resulting in a prompt by the user interface for a password.
Examples:
- ftp://username:password@host.com/
- ftp://username@host.com/
What's the 'authority' in a URL?
The authority of a URL is made of the userinfo, the hostname and the port. The userinfo and port are optional. When the port is not present, a default port for the specific scheme is assumed. For example port 80 for http or 443 for https.
Examples:
- username:[email protected]/
- subdomain.domain.com
- www.superaddress.com:8080
What's the 'fragment' in a URL?
Also known as a hash, the fragment is a pointer to a secondary resource with the first resource. It follows the # character.
Examples:
- http://www.foo.bar/?listings.html#section-2
What's the 'path' in a URL?
The path of a URL is made of segments that represent a structured hierarchy. Each segment is separated by a the / character. You can think of a path as a directory structure.
Examples:
- http://www.foo.bar/segment1/segment2/some-resource.html
- http://www.foo.bar/image-2.html?w=100&h=50
- ftp://ftp.foo.bar/~john/doe?w=100&h=50
What's the 'query string' in a URL?
The query contains extra information that is usually in the key-pair format. Each pair is usually separated by an ampersand & character. It follows the ? character.
Examples:
- http://www.foo.bar/image.jpg?height=150&width=100
- https://www.secured.com:443/resource.html?id=6e8bc430-9c3a-11d9-9669-0800200c9a66#some-header