URL Parser API

Parse any URL into protocol, auth, host, port, path, query params and fragment. Edit query parameters in a decoded table. Free and client-side.

The URL Parser is also available as a free REST API. Send a POST request with a JSON body to https://dot.tools/api/tools/url-parser — no authentication, no API key, CORS enabled. Successful calls return { "ok": true, "result": { … } }; failures return HTTP 400 or 422 with an error body.

Request body

FieldTypeRequiredDescription
urlstringrequiredThe absolute URL to parse, including protocol.
paramsobject[]optionalOptional replacement query parameters — when given, the URL is rebuilt with these and the result reflects the new URL.

Response

FieldTypeRequiredDescription
hrefstringrequiredThe full normalized URL.
originstringrequiredProtocol + host + port.
protocolstringrequiredURL scheme without the trailing colon.
usernamestringrequiredUsername from the authority, decoded.
passwordstringrequiredPassword from the authority, decoded.
hostnamestringrequiredHost without port.
portstringrequiredExplicit port, or empty when using the default.
pathnamestringrequiredPath component.
searchstringrequiredRaw query string including the leading ?.
hashstringrequiredFragment without the leading #, decoded.
paramsobject[]requiredDecoded query parameters in order, duplicates preserved.

Example request

curl -X POST https://dot.tools/api/tools/url-parser \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://demo:s3cret@api.example.com:8443/v1/search?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools#results"
}'

Sample response

{
  "ok": true,
  "result": {
    "href": "https://demo:s3cret@api.example.com:8443/v1/search?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools#results",
    "origin": "https://api.example.com:8443",
    "protocol": "https",
    "username": "demo",
    "password": "s3cret",
    "hostname": "api.example.com",
    "port": "8443",
    "pathname": "/v1/search",
    "search": "?q=caf%C3%A9%20%26%20tea&lang=nl&tag=dev&tag=tools",
    "hash": "results",
    "params": [
      {
        "key": "q",
        "value": "café & tea"
      },
      {
        "key": "lang",
        "value": "nl"
      },
      {
        "key": "tag",
        "value": "dev"
      },
      {
        "key": "tag",
        "value": "tools"
      }
    ]
  }
}

Use the free URL Parser in your browser, read the URL Parser guide, or import the full OpenAPI specification.