Inspect, parse, encode and debug URLs
Inspect, parse, encode and debug URLs
A URL is not one undifferentiated string. Scheme, host, port, path, query and fragment have separate roles, and reserved characters should not be encoded blindly.
Start with structure
Use URL Inspector on the complete absolute URL. Confirm the scheme, host, optional port, pathname, repeated query keys and fragment before changing anything.
Encode only the component
When a search term contains spaces or an ampersand, encode that value rather than the whole URL. Encoding `?`, `&` and `=` as ordinary text can destroy the query structure.
- Preserve repeated keys
- Distinguish an empty value from a missing key
- Check plus-for-space conventions in the receiving application
Debug without claiming a live check
These tools do not fetch DNS, redirects or HTTP status. After local inspection, test the final URL in the target environment and verify every redirect and analytics parameter.
Audience and prerequisites
For developers, marketers, and support teams diagnosing malformed links, lost parameters, encoding errors, and unexpected fragments before making a network request.
- Obtain the complete absolute
URL - Record the expected scheme, host, path, and parameter values
- Know whether the receiving form treats plus as a space
Complete workflow
- Parse the untouched absolute
URLinto scheme, host, port, path, query, and fragment - List repeated and empty query values without collapsing them
- Identify the one component that contains unsafe characters
- Encode only that component
- Reassemble the
URLand test redirects in the real destination
End-to-end example 1: Encode one search value
Expected result: q=summer%20sale%20%26%20clearance while the URL separators remain structural.
Verification: Parse the rebuilt URL and confirm q decodes to the original phrase.
- Parse https://example.com/search?q=summer sale & clearance
- Separate the intended q value
- Encode summer sale & clearance
- Rebuild the query
End-to-end example 2: Preserve repeated tags and a fragment
Expected result: Two tag values, one explicit empty value, and the details fragment.
Verification: Open the final URL in the target application and confirm its filter and fragment behavior.
- Parse https://example.com/items?tag=red&tag=blue&empty=#details
- Keep both tag entries and the empty value
- Leave #details after the query
Common errors
- Encoding the entire
URLwith encodeURIComponent - Converting repeated query keys to a single
objectvalue - Treating a fragment as server request data
Troubleshooting
- For malformed percent escapes, recover the complete source bytes instead of guessing
- For relative paths, supply an explicit trusted base
URL - For redirect loss, inspect each HTTP hop outside the local parser
Validate the result
The repaired URL must parse as an absolute URL, preserve every intended value, and survive the real redirect chain without changing the canonical destination.
When to use the destination or a professional tool
Use browser network tools, curl, server logs, or the destination platform when DNS, HTTP status, redirect policy, or form-encoding semantics are involved.
