NewPlus, API and MCP are live — run 175 tools from your own stack.
100www

Tool 196 · H16 · Host / Network · Updated Nov 2026

URL Parser

Split a URL into scheme, authority, path, query and fragment, then rebuild it correctly.

Browser Free No sign-up
How it works
100www.dev/tools/url-parser

Protocol

https:

Username

—

Password

—

Hostname

example.com

Port

8443

Path

/path

Query

?a=1&b=two

Fragment

#section

Origin

https://example.com:8443

Query parameters · 2

a1
btwo

JSON

{
  "input": "https://example.com:8443/path?a=1&b=two#section",
  "protocol": "https:",
  "username": "",
  "password": "",
  "hostname": "example.com",
  "port": "8443",
  "pathname": "/path",
  "search": "?a=1&b=two",
  "hash": "#section",
  "origin": "https://example.com:8443",
  "params": {
    "a": "1",
    "b": "two"
  }
}

What it does

A URL parser breaks an address into its components so you can inspect what a browser will actually do. It is the safe alternative to regex for tasks like extracting a host, checking a redirect target or rebuilding a query string without losing encoding.

How it works

A URL has a scheme, an authority (userinfo, host, port), a path, a query and a fragment. The WHATWG URL parser normalises as it parses: lowercase scheme and host, percent-encode unsafe characters, resolve dot segments and drop default ports.

The host may be a domain, an IPv4 address or an IPv6 literal in brackets. Brackets are required for IPv6, and a port follows a colon. Credentials before the @ are userinfo and should rarely appear in public URLs.

The query is not a structured format. Repeated keys, ordering and encoding are application-defined. Use URLSearchParams for correct encoding rather than string concatenation, and remember that + means space only in form encoding, not in a generic URL.

The fragment is client-side only; it is not sent to the server. Single-page apps sometimes put routing state there, which is why the same path can render different views.

Normalisation can change meaning. Strip trailing dots carefully, decode only once, and never decode a path before splitting it — an encoded slash is not a separator. When in doubt, let the platform parser do the work.

When to use it

  • Extract the host from untrusted input before an allowlist check.
  • Rebuild a URL with an added query parameter without double encoding.
  • Inspect a redirect target before following it.
  • Debug why two URLs that look the same behave differently.

Glossary

Scheme
The protocol prefix, such as https or mailto.
Authority
The userinfo, host and port portion of a URL.
Percent-encoding
Representing bytes as % followed by two hex digits.
Fragment
The part after #, handled by the client and not sent to the server.
URLSearchParams
The platform API for parsing and building query strings with correct encoding.

Frequently asked questions

Why do two URLs with the same host behave differently?+

Path normalisation, percent-encoding, a trailing slash or a fragment can change routing. Compare the parsed components, not the raw strings.

Is + a space in a URL?+

Only in application/x-www-form-urlencoded data. In a generic URL path or query, a space is %20, and + is a literal plus.

Can I parse a URL with a regex?+

Not reliably. The grammar allows userinfo, IPv6 literals, encoded delimiters and relative forms. Use the platform parser.

Why is my query parameter missing?+

It may have been dropped by a redirect, double-encoded, or placed after the fragment. Inspect the final URL the browser requested.

Does parsing make a URL safe?+

No. Parsing tells you what it contains. Safety depends on validating the scheme and host and on how the value is used.

API & MCP

No API endpoint

This tool runs entirely in your browser. It is not available over the REST API or MCP.

Shareable result

https://100www.dev/tools/url-parser?u=https%3A%2F%2Fexample.com%2Fpath%3Fa%3D1

100www

100www engineering

Editorial

Reviewed by Steve · · Report an error

Tested from the 100www probe network; results vary by location and network.