Back to Home

URL to JSON Converter

Paste a URL to get structured JSON: protocol, host, port, path segments, query parameters and hash. Repeated keys become arrays and %20 is decoded.

Paste a URL, click "Convert to JSON" and the link comes back as structured JSON. The output fields are protocol, username and password, hostname, port, origin, pathname plus pathSegments (the path split into an array), query (an object of the query parameters) and hash. Repeated query keys are merged into arrays, and percent-encoded values such as %20, %2F or %E4%B8%AD are decoded to readable text. Everything runs locally through the browser's built-in URL API, so the link is never uploaded.

URL to JSON: Parse Query Strings, URL Parameters and API Request Links Online

Parse a URL query string into structured JSON, check repeated parameters and percent-encoded values field by field, and skip the manual link-splitting and throwaway regex.

How it works

The tool uses the browser's built-in URL API to split the link you paste into JSON fields: protocol, user info, hostname, port, path segments, query parameters and hash. Repeated query keys are merged into arrays and percent-encoded values are decoded automatically.

Why JSON output?

JSON (JavaScript Object Notation) is a lightweight data-interchange format that humans can read and machines can parse. Once a URL is broken into JSON you can paste it straight into code, API docs or a test fixture.

How to use the URL to JSON converter

  1. 1

    Paste the URL you want to inspect

    Drop the full link into the left-hand box. HTTP, HTTPS, FTP and custom schemes all work, including links with user:pass@, a port and a #fragment. A scheme-less form such as example.com/path?a=1 is completed to http:// automatically.

  2. 2

    Click "Convert to JSON"

    The tool calls the browser's built-in URL API — which follows the WHATWG URL Standard — to split the link into its components and serialise them as JSON with two-space indentation.

  3. 3

    Check the parsed fields

    Read protocol, hostname, port, pathname and pathSegments, query and hash in the result panel. Inside query, single-value parameters are strings and repeated parameters are arrays, so multi-value keys are obvious.

  4. 4

    Copy or download the JSON

    Use the copy button to put the result on your clipboard, or the download button to save it as url.json and reuse it in code, API docs or a test fixture.

References

  • WHATWG URL Standard

    The living standard browsers actually implement, defining the parsing algorithm and URLSearchParams behaviour this tool relies on.

  • RFC 3986 — URI Generic Syntax

    The authoritative IETF specification for URI/URL syntax, components and percent-encoding rules.

  • MDN — URLSearchParams

    Web API reference for reading, iterating and building URL query strings in JavaScript, including get, getAll and toString.

  • MDN — URL

    Reference for every URL object property: protocol, hostname, port, pathname, search and hash.

  • RFC 8259 — JSON

    The IETF specification for the JSON data-interchange format used for this tool's output.

Related Tools

Frequently Asked Questions

How do I turn URL parameters into JSON?
Paste the whole URL into the input box and click "Convert to JSON". Everything after the ? is split into key-value pairs under the query field, repeated keys are merged into arrays, and you also get protocol, hostname, port, pathname and hash — no manual splitting or throwaway regex required.
What are the rules for parsing URL parameters?
The query string starts at the first ?, parameters are separated by &, and each key is split from its value at the first =. Anything after # is the fragment, not a parameter. Keys are case-sensitive, so A=1 and a=2 are two different keys, and both ?a= and a bare ?b parse to an empty string.
How are repeated parameter names (?tag=a&tag=b) handled?
Repeated keys are merged into a JSON array, so you get "tag": ["a", "b"], while keys that appear once stay plain strings. That makes multi-value parameters visible instead of silently keeping only the last value the way some parsers do.
Does it support nested parameters like filter[color]=red?
They are kept exactly as written rather than expanded into nested objects: filter[color]=red&filter[size]=M parses to the two flat keys "filter[color]": "red" and "filter[size]": "M". Bracket nesting is not part of the URL standard, only a convention in some backend frameworks — use qs.parse from the qs library if you need real nesting.
How are non-ASCII characters and %20 or %2F handled?
They are percent-decoded automatically. %20 becomes a space, %2F becomes a slash and %E4%B8%AD%E6%96%87 becomes readable text, so the JSON output can be compared directly against backend logs or API documentation.
How do I convert JSON back into a URL query string?
This tool is one-way, URL to JSON only. The reverse is a single line of code: new URLSearchParams({a: 1, b: 'x y'}).toString() returns a=1&b=x+y with encoding already handled, ready to append after the question mark. For a single value use encodeURIComponent, or the URL Encode / Decode tool on this site.
How do I parse URL parameters in JavaScript?
Three lines: const sp = new URL(location.href).searchParams, then sp.get('id') for a single value, sp.getAll('tag') for repeated keys, and Object.fromEntries(sp) to get a plain object — note that the last form keeps only the final value of a repeated key. This is the same API the tool uses internally.
Is my URL sent to a server?
No. Parsing happens entirely in your browser through the built-in URL API, so the link and its parameters never leave your device — which makes it safe to inspect URLs containing tokens, signatures or internal hostnames.
What is the difference between a URL and a URI?
A URI identifies a resource; a URL identifies it and also describes how to reach it, including the scheme and host. Every URL is a URI, but not every URI is a URL — a plain urn: identifier, for example, is a URI but not a URL.