JSON URL Encode
Paste JSON and get a URL-safe encoded string ready to drop into a query parameter or form body. Validates the JSON first and offers minify-before-encode.
Last updated: May 27, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON URL Encode?
Browsers and servers exchange data through URLs and form bodies, but URLs have restrictions on what characters they can contain. Characters like `{`, `"`, and spaces must be percent-encoded for the URL to remain valid. When you want to pass a JSON value through a query parameter — `?data=...` — you need to URL-encode it first.
This tool handles three encoding modes: `encodeURIComponent` (recommended for query values, encodes everything reserved), `encodeURI` (preserves URL-syntax characters like `/` and `?`), and form encoding (uses `+` for space, the standard for `application/x-www-form-urlencoded` POST bodies).
How to Use JSON URL Encode
Paste JSON into the input panel.
Pick an encoding mode (encodeURIComponent is the safe default for query parameters).
Toggle "Minify JSON before encoding" to strip whitespace and reduce URL length.
Copy the encoded output.
Common Use Cases
- Embedding a JSON payload in a query string (?filters=...).
- Building a form POST body containing a JSON value.
- Generating links to a debug or playground page that pre-fills a JSON input.
- Encoding JSON before passing it through a single-page-app URL fragment.
Example Input and Output
A small JSON object is minified and percent-encoded for a query string.
{"q":"hello world","page":1}%7B%22q%22%3A%22hello%20world%22%2C%22page%22%3A1%7DPrivacy
All encoding happens in your browser. No JSON is sent to a server.
URL length limits
While there is no strict limit, browsers and servers often cap URLs at around 2,000-8,000 characters. For large JSON payloads, consider POSTing in a request body instead of embedding in the URL.
Frequently Asked Questions
When should I use encodeURIComponent vs encodeURI?
Use encodeURIComponent for individual query parameter values — it encodes &, =, ?, /, and other URL-syntax characters that would break the URL. encodeURI preserves those, intended for encoding a complete URL.
What is form encoding?
application/x-www-form-urlencoded — the default for HTML form submissions. It is identical to encodeURIComponent except spaces are encoded as + instead of %20.
Why minify before encoding?
Encoded whitespace adds bytes to the URL. Minifying first removes formatting whitespace, producing a shorter encoded string.
Does this send my JSON anywhere?
No. All encoding happens locally in your browser.
Related Tools
JSON URL Decode
URL-decode JSON from query strings or form bodies. Optionally treats + as space (form mode) and pretty-prints the resulting JSON.
URL Encoder/Decoder
Encode and decode URL strings with special characters.
JSON Encode Online
Escape a string for use as a JSON value. Handles quotes, backslashes, control characters, and optionally Unicode and forward slashes. Copy the ready-to-paste JSON string.
JSON Decode Online
Decode a JSON-escaped string back to plain text. Unescapes quotes, backslashes, newlines, and Unicode \uXXXX sequences. Works with or without surrounding quotes.
JSON Formatter
Format, validate, and beautify JSON instantly — with clear error messages, Tree View, Diff mode, and Schema validation.
JSON Validator
Validate JSON syntax online. Shows valid/invalid status, error location (line and column), and structure stats including type, key count, and depth.

