Parse URL

Split a URL into scheme, authority, host, port, path, query, and fragment components.

freeworks offlinenothing uploaded
ToolURL Parser
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

URI delimiters separate scheme, userinfo, host, port, path, query, and fragment while percent-encoded bytes remain distinct from display text. Host casing and default ports can be normalized without changing path semantics.

  • RFC component parsing provides stable fields.
  • Browser schemes add special handling beyond the generic grammar.

Worked example

Parse Full URL
Break down a URL into its component parts
Input
											https://api.example.com:8080/v1/users?page=1&limit=10#results
										
Output
												=== URL Components ===
protocol: https:
hostname: api.example.com
port: 8080
pathname: /v1/users
search: ?page=1&limit=10
hash: #results
origin: https://api.example.com:8080
host: api.example.com:8080
username: (none)
password: (none)

=== Query Parameters ===
page: 1
limit: 10
											

When to use this

Redirect handlers, crawlers, and URL security reviews parse components.

Edge cases

  • An @ in userinfo can look like the host separator.
  • Fragments stay client-side and are not sent in HTTP.
  • Unicode hostnames may normalize to punycode.

References