Browser-based Convert tool

Query String to JSON

Paste a query string or URL to decode parameters, repeated keys and percent-encoded values.

100% 브라우저 기반 · 서버 업로드 없음 · 무료
Browser processing · up to 5 MB per file
0 chars
0 chars

Query String to JSON Converter

Paste a query string, full URL, or load a local file to decode parameters into a structured JSON object. This tool handles repeated keys, percent-encoded values, and can repair common syntax errors in malformed JSON documents.

Decode Parameters and Structure Data

The primary workflow converts raw query strings into a usable JSON object. Paste your input directly into the panel or load a local file from your device. The converter parses the string, decoding percent-encoding (e.g., %20 becomes a space) and mapping parameters to key-value pairs.

If your query string contains repeated keys (for example, ?id=1&id=2), the converter automatically structures these as an array in the JSON output ({"id": [1, 2]}). This is critical for frameworks that expect array notation for multi-valued parameters, ensuring the output matches how most JavaScript environments parse URLSearchParams.

Repair Malformed JSON Documents

Beyond standard query string conversion, the tool includes a repair step for messy JSON inputs. If you are working with JSON that has been manually edited or generated by inconsistent tools, the converter can fix specific syntax issues:

  • Trailing Commas: Removes commas that precede a closing brace or bracket.
  • Comments: Strips out // and /* */ style comments that are invalid in strict JSON.
  • Quote Standardization: Converts single-quoted strings to double-quoted strings and quotes bare member names.

This repair process re-reads the document after cleaning. However, it cannot infer missing closing braces, undefined variables (like Python True or None), or logical structural errors. Those issues still require manual editing.

Edge Cases and Data Precision

Be aware of two specific limitations when using the output in your application stack:

  1. Plus Signs (+): In standard form-encoded query strings, a + represents a space. In raw path segments or when manually constructing query strings, a + is a literal plus. Ensure you encode the component you actually control to avoid decoding errors.
  2. Large Integer Precision: JavaScript uses IEEE-754 doubles for numbers. Any integer exceeding 2^53 (9,007,199,254,740,991) will lose precision when parsed by standard JSON parsers. While this converter preserves long literal numbers exactly as typed in its text output, if you parse this JSON in a Node.js or browser environment, the tail digits may be dropped. For IDs larger than 2^53, keep them as strings in your source document.

Privacy and Local Processing

All processing happens locally in your browser. The tool does not upload your query strings, URLs, or files to a conversion server. Because the input remains on your device, you can safely process sensitive data without transmission risk. However, do not paste secrets or personal data on shared or public devices.

Important: browser parsers cover common practical cases. Always review generated files before using them in production, especially for configuration, subtitles, images and security-sensitive data.

Frequently asked questions

How does the converter handle repeated query parameters?

Repeated keys in the input (e.g., ?a=1&a=2) are combined into an array in the JSON output ({"a": [1, 2]}). This mirrors the behavior of standard web APIs where multiple values are passed for a single key.

Why is my plus sign (+) decoding incorrectly?

In form-urlencoded query strings, + is interpreted as a space. If your source data contains a literal plus sign, it must be percent-encoded as %2B. If you are working with a raw path or a string that has already been encoded, ensure you are using the correct encoding method for that context.

Can this tool fix JSON with syntax errors like comments or trailing commas?

Yes. The tool includes a repair step that removes trailing commas, deletes comments, converts single quotes to double quotes, and quotes bare keys. It then attempts to parse the cleaned document. Complex structural errors, such as missing closing braces or undefined language-specific values, are not automatically fixed.

Why do large numbers change value when I format JSON?

JavaScript numbers are stored as 64-bit floating-point doubles. Integers larger than 2^53 cannot be represented exactly, causing precision loss. To preserve exact large numeric IDs, wrap them in quotes in the JSON source so they are treated as strings.

Is my input data uploaded to a server?

No. The entire conversion and repair process occurs locally within your browser using client-side JavaScript. No data is sent over the network, which makes it suitable for handling sensitive query parameters or API keys locally.

Should I verify the output before using it in production?

Yes. While the tool handles standard encoding and common syntax repairs, you should review the final JSON object against your original input. Specifically check that repeated keys are structured as arrays and that special characters were decoded as intended before integrating the output into your application.