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
| Character | Encoded | Why |
|---|---|---|
{ } | %7B %7D | Not allowed unencoded in URLs |
" | %22 | Reserved |
: | %3A | Separates scheme and port |
, | %2C | Reserved in some contexts |
| space | %20 | Not allowed in URLs |
& = | %26 %3D | Separate query parameters |
é, 中, 😀 | UTF-8 bytes, e.g. %C3%A9 | Non-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.
Related tools
Decode with JSON URL Decode.
How to use the JSON URL Encode
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The result appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.