URL Parser

When a webhook misfires or a tracking link carries the wrong payload, the fastest fix is to break the URL apart and read each piece. Paste any URL and this parser splits it into its parts: scheme, username and password, host, port, path, query string and fragment, then expands the query into a labelled table of key and value pairs. It runs on our server with PHP’s standard URL parser, so what you see is exactly how a PHP backend would read the same link.

How to parse a URL

  1. 1

    Paste the URL

    Drop in any URL, absolute or relative. There is nothing to click; it parses as you type.

  2. 2

    Read the components

    The table fills with the scheme, host, port, user, password, path, query and fragment it finds. Empty parts show a dash.

  3. 3

    Expand the query

    Every `key=value` pair is listed on its own row, with percent-encoding and `+` decoded to real characters.

  4. 4

    Copy the parameters

    The copy button grabs every query parameter at once as `key=value` lines, ready to paste into an API client.

Anatomy of a URL

Take this URL: https://user:pass@api.example.com:8443/v1/users?page=2&sort=name#profile. The parser breaks it into:

Component Value
scheme https
user user
pass pass
host api.example.com
port 8443
path /v1/users
query page=2&sort=name
fragment profile

The query string is then expanded into its own table: page = 2 and sort = name.

How the query string is read

  • Values are percent-decoded and + becomes a space, so q=hello%20world and q=hello+world both read as hello world.
  • A pair is split on its first =, so token=a=b=c keeps a=b=c as the value.
  • Repeated keys keep only the last value: ?id=1&id=2 reports id = 2. To keep every value, use array syntax id[]=1&id[]=2, which is shown as a list.
  • Bracketed keys such as filter[status]=open become a nested structure, displayed as JSON.

Ports, paths and fragments

  • The port is shown exactly as written. Nothing is added or removed, so :443 appears as 443, and a URL with no port leaves the row blank.
  • A trailing slash changes the path: https://a.com has an empty path, while https://a.com/ has the path /.
  • The fragment (after #) is a browser-only value used to jump to an anchor or drive a client-side router. It never reaches the server, so anything a backend must read belongs in the query string.
  • The host is returned exactly as typed; this parser does not convert internationalized (non-ASCII) domains to or from Punycode.

Frequently Asked Questions

Yes. A relative link such as /v1/users?ref=nav has no scheme or host, so those rows stay empty while the path and query are still filled in. Only a badly malformed URL, for example one with a non-numeric port like http://a.com:port, is rejected outright.

Only the last value is kept, so ?id=1&id=2 reports id = 2, exactly as a PHP backend would read it. If you need every value, use array syntax id[]=1&id[]=2 and they appear as a list.

The parser reports the port precisely as written. It never removes a default port or adds a missing one, so a URL without a port shows a blank row and https://a.com:443 shows 443.

The URL is sent to our server to be parsed, since this tool runs server-side rather than only in your browser. We do not save the URLs themselves; we record only an anonymous count that the parser ran.

Related Tools

Tool available in other languages