YourTools.
简体中文
Back to the catalog
Tools

URL parse and query convert

Split a URL into its parts and parameters, turn a query string into JSON, or build a query string from a JSON object.

Process locally

Files stay in this browser session. Closing or clearing releases them.

Add text

Type or paste the text to process

Adjust settings

Optional: Operation, Percent-encoding, Sort parameters by name

URL parse and query convert

Run

Processes in this browser; cancel at any time

Add text first

About this tool

Split a URL into its protocol, host, port, path, query parameters and fragment, with percent-encoded text such as %E4%BD%A0 decoded. You can also turn a query string into JSON for an API test, or build a query string from a JSON object.

Repeated parameters are all kept, decoding and encoding can follow encodeURIComponent or HTML forms (+ for spaces), and parameters can be sorted by name. Up to 1 MB of text is processed in your browser and is not uploaded.

How to use it

  1. Paste a URL, a query string or a JSON object, or select “Use example” to load a URL with encoded Chinese text and a repeated parameter.
  2. Choose the “Operation”: “Parse a URL”, “Query string to JSON” or “JSON to query string”.
  3. Pick the “Percent-encoding”, and tick “Sort parameters by name” if you want them sorted.
  4. Select “Run”, then preview the result and download it as url.json, query.json or query.txt.

Formats and limits

Input
Text
Output
JSON, Plain text
Size limit
1 MB
Settings
Operation (Parse a URL, Query string to JSON, JSON to query string); Percent-encoding (Percent-encoding, Form encoding, None, keep as written); Sort parameters by name
Privacy
Files stay in the current browser session. No file bytes are uploaded.
Price
Free, no sign-up

Common questions

Why is + not turned into a space?

With “Percent-encoding (encodeURIComponent)”, + stays a plus sign and only %20 means a space. Choose “Form encoding (+ for spaces)” for query strings from HTML forms, where + stands for a space.

How are repeated parameters such as tag=a&tag=b handled?

“Parse a URL” lists each one separately, in order. “Query string to JSON” collects the values into an array, and “JSON to query string” turns an array back into repeated keys.

Are nested keys like user[name]=Tom supported?

No. Brackets stay part of the key, so the JSON gets a key named user[name]. When building a query string, a nested object, or an array inside an array, is written as JSON text and then encoded.

What if the URL has no protocol?

http:// is assumed, so example.com/a?b=1 can be parsed too. The port is empty when it is the protocol’s default, and a non-ASCII domain is shown in its xn-- Punycode form.

What does “Malformed percent-encoding” mean?

A % sign is not followed by a valid encoded character, for example a bare 100% in a value. Choose “None, keep as written” to see the text without decoding, or write the % as %25.