Skip to content
XUtilHub

JSON URL Encoder – Encode JSON for URLs

URL-encode JSON so it can be passed safely in query strings. Optionally minify first. Free online percent-encoder.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded
Input
Output

About the JSON URL Encode

Percent-encode JSON so it can be sent safely as a URL query parameter.

Key features

  • Percent-encodes JSON for query strings and URLs
  • Uses encodeURIComponent rules (RFC 3986)
  • Optional minification for shorter URLs
  • Full UTF-8 support for any language
  • Validates the JSON before encoding
  • Instant and private

Put JSON safely in a URL

Sometimes you need to pass structured data through a link: filters in a dashboard URL, state in a redirect, a payload in a webhook test, or options in a deep link. Raw JSON contains characters that URLs treat specially, so it must be percent-encoded first.

Example

{"filter":{"status":"open","tags":["bug","ui"]}}

encodes to:

%7B%22filter%22%3A%7B%22status%22%3A%22open%22%2C%22tags%22%3A%5B%22bug%22%2C%22ui%22%5D%7D%7D

which you can use as https://app.example.com/issues?q=%7B%22filter%22...

Characters that get encoded

CharacterEncodedWhy
{ }%7B %7DNot allowed unencoded in URLs
"%22Reserved
:%3ASeparates scheme and port
,%2CReserved in some contexts
space%20Not allowed in URLs
& =%26 %3DSeparate query parameters
é, 中, 😀UTF-8 bytes, e.g. %C3%A9Non-ASCII

In code

const url = `/search?q=${encodeURIComponent(JSON.stringify(filters))}`;
from urllib.parse import quote
url = "/search?q=" + quote(json.dumps(filters, separators=(",", ":")))

Tips

  • Minify first. Keep "Minify JSON first" enabled; indentation and line breaks would otherwise bloat the URL considerably.
  • Consider Base64URL. For shorter, cleaner links, JSON to Base64 with URL-safe mode produces output with no % sequences.
  • Large payloads. Use POST requests rather than very long URLs.

Decode with JSON URL Decode.

How to use the JSON URL Encode

  1. Paste your data into the input box, upload a file, or click Sample to try it out.
  2. Adjust the options above the editor if you need to (indentation, delimiter, and so on).
  3. The result appears instantly in the output panel. Any errors are shown with their line and column.
  4. Click Copy to copy the result, or Download to save it as a file.

Frequently asked questions

Why do I need to URL-encode JSON?

Characters such as {, }, ", :, spaces and & have special meaning in URLs or aren't allowed in them. Percent-encoding replaces them with %XX codes so the JSON survives intact as a single parameter value.

Should I use encodeURI or encodeURIComponent?

For a parameter value, always encodeURIComponent. encodeURI leaves characters like &, = and ? untouched, which would break your query string.

Is there a maximum URL length?

There's no official limit, but browsers, proxies and servers commonly cap URLs at around 2,000–8,000 characters. For large JSON, send it in a POST body instead.

Why are spaces encoded as %20 and not +?

%20 is the RFC 3986 encoding and is understood everywhere. + only means space in application/x-www-form-urlencoded form data.

Is my JSON uploaded to a server?

No. All JSON tools run entirely in your browser, so your data never leaves your device.

Is there a size limit?

There is no fixed limit. Files of several megabytes work fine; very large files depend on your device's memory.

Do I need an account?

No. Every JSON tool is free and works without signing up.

Last updated:

Related JSON tools