Parts Analyzer

Parts Analyzer

URL parser online. Visual breakdown of URL components: protocol, host, port, path, query, hash. Analyze URL structure instantly and free.

0 chars

URL to Analyze

URL Structure

protocol://hostname:port/path?query#hash

Features

  • Visual breakdown of URL components
  • Display protocol, host, port, path, query, hash
  • Syntax highlighting for each part
  • Copy individual components
  • Automatic query string parsing
  • Show URL structure visually

Common Use Cases

  • Understand complex URL structure
  • Debug URL parsing issues
  • Learn URL anatomy
  • Extract specific URL parts
  • Verify URL component values

URL Anatomy and Components

URLs (Uniform Resource Locators) are structured addresses for web resources. Understanding URL parts is essential for web development, API design, and debugging.

URL structure:

https://user:pass@www.example.com:443/path/to/page?key=value#section
└─┬──┘ └───┬───┘ └─────┬──────┘ └┬┘ └────┬────┘ └───┬───┘ └──┬───┘
protocol  auth      host       port   path       query   fragment

Component descriptions:

  • Protocol - Transfer method (http, https, ftp, ws, etc.)
  • Authentication - Optional username:password (rarely used)
  • Host - Domain name or IP address
  • Port - Optional (default: 80 for HTTP, 443 for HTTPS)
  • Path - Resource location on the server
  • Query - Key-value parameters after ?
  • Fragment - Page section anchor after #

Use cases: Extract domains for allow-lists, parse query parameters, check protocols for security, understand API endpoint structure.

Examples

Valid - Full URL breakdown
https://api.example.com:8080/v1/users?id=123&sort=name#results

Protocol: https
Host: api.example.com
Port: 8080
Path: /v1/users
Query: ?id=123&sort=name
Fragment: #results
Valid - Simple URL without optional parts
https://example.com/page

Protocol: https
Host: example.com
Port: (default 443)
Path: /page
Query: (none)
Fragment: (none)
Valid - URL with authentication
ftp://user:pass@ftp.example.com/files

Protocol: ftp
Auth: user:pass
Host: ftp.example.com
Path: /files

Frequently Asked Questions

What's the difference between path and query?

The path identifies a resource (/api/users), while the query provides parameters (?id=123&sort=name). Paths are hierarchical (like folders), queries are key-value pairs. Both are sent to the server.

What's the difference between query and fragment?

The query (?key=value) is sent to the server in HTTP requests. The fragment (#section) is client-side only—it's not sent to the server and is used for page navigation (scrolling to sections).

Why is the port sometimes missing?

Ports have defaults: HTTP uses port 80, HTTPS uses 443. If the URL uses default ports, they're omitted (https://example.com is the same as https://example.com:443). Non-standard ports must be explicit (:8080).

What is the host vs domain?

The host is the full network address (e.g., www.example.com or api.example.com). The domain is the registered name (example.com). The host includes subdomains (www, api, blog, etc.).

Can I use authentication in URLs safely?

No. https://user:pass@example.com exposes credentials in logs, browser history, and referrer headers. Modern browsers discourage this. Use Authorization headers or secure tokens instead.