Validate URL

Parse an absolute URL and display its protocol, host, path, query, and fragment.

freeworks offlinenothing uploaded
ToolURL Validator
Input
Output
Put this on your own site

The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.

Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.

Preview

How it works

The browser URL parser resolves the input into protocol, hostname, port, pathname, query, and fragment components. Only http, https, ftp, and ftps are valid here; other parseable schemes return a warning state.

  • WHATWG parsing matches browser behavior.
  • The allowlist covers common web and file-transfer links.

Worked example

Valid URL
Validate a well-formed HTTPS URL with path and query
Input
											https://api.example.com/v2/users?active=true&page=1
										
Output
												Valid URL
Protocol: https:
Host: api.example.com
Path: /v2/users
Query: ?active=true&page=1
											

When to use this

Callback forms, crawlers, and documentation tools inspect URLs.

Edge cases

  • Credentials or ports still parse and are exposed as components.
  • javascript: and data: can parse but are warned as uncommon schemes.
  • A relative path fails because no base URL is supplied.

References