Tools

Home
JSON FormatterSQL FormatterJS ValidatorMinify CSS
Merge PDFCompress PDFImage to PDF
JPG to PNGPNG to WebPCrop Image

URL Encode JSON

URL-encode a JSON string for use in URLs, query parameters, and APIs

Your files never leave your browser
JSON Input0 chars, 0 lines
URL-Encoded Output0 chars, 0 lines
Ready·

Paste raw JSON, get a percent-encoded string you can drop straight into a query parameter, redirect URL, or webhook config. The tool uses JavaScript's encodeURIComponent under the hood — the same function your code would call, just without opening a console. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste JSON
➔
encodeURIComponent()
➔
URL-Safe String

The encoder reads every character in your JSON text and replaces anything that isn't a letter, digit, or one of a few safe punctuation marks (- _ . ~ ! * ' ( )) with a percent sign followed by its hex code. So { becomes %7B, a double quote becomes %22, and a space becomes %20. The output is one continuous string you can drop straight into a URL parameter.

Examples

Simple Key-Value Object

Passing user data as a query parameter in a redirect URL.

INPUT
{"name":"Jane","id":42}
OUTPUT
%7B%22name%22%3A%22Jane%22%2C%22id%22%3A42%7D

Nested Object with Array

Sending filter criteria to an API endpoint that expects JSON in the query string.

INPUT
{"filters":{"status":"active","tags":["vip","us"]}}
OUTPUT
%7B%22filters%22%3A%7B%22status%22%3A%22active%22%2C%22tags%22%3A%5B%22vip%22%2C%22us%22%5D%7D%7D

JSON with Special Characters

A webhook payload containing a URL and ampersands — exactly the kind of thing that breaks URLs when left unencoded.

INPUT
{"url":"https://example.com?a=1&b=2","note":"test & demo"}
OUTPUT
%7B%22url%22%3A%22https%3A%2F%2Fexample.com%3Fa%3D1%26b%3D2%22%2C%22note%22%3A%22test%20%26%20demo%22%7D

Who Uses This

👨‍💻 Backend Developers

Stuffing JSON config into redirect URLs and OAuth callback parameters.

🔧 QA Engineers

Building test URLs with encoded JSON payloads to hit API endpoints directly.

⚡ DevOps

Encoding JSON for webhook URLs, CI/CD pipeline variables, and infrastructure configs.

📈 Data Analysts

Passing JSON filter objects as URL parameters in reporting dashboards and BI tools.

Common Mistakes

Double-encoding the JSON

If your JSON is already URL-encoded and you encode it again, you get things like %2522 instead of %22. The server on the other end won't know what to do with it. Only encode once.

Encoding only part of the JSON

Some people encode just the values but leave the braces and colons raw. That still breaks the URL. You need to encode the entire JSON string as one unit — braces, quotes, colons, everything.

Hitting server URL length limits

URL-encoded JSON balloons to roughly 3x its original size. A 1 KB JSON object becomes a 3 KB query string. Most servers cap URLs around 2,048 to 8,192 characters. For large payloads, use a POST body instead of a query parameter.

Technical Details

Frequently Asked Questions

What does URL encoding do to JSON?

It replaces every reserved character with a percent-encoded version. Curly braces turn into %7B and %7D, quotes become %22, colons become %3A. The result is a flat string that's safe to drop into any URL without confusing the browser or server about where one parameter ends and another begins.

Does the JSON need to be valid before encoding?

Nope. The encoder treats your input as a plain string — it doesn't parse or validate the JSON structure. That said, if the receiving server expects valid JSON after decoding, you'll want to make sure it's correct before encoding. Our JSON Formatter can help with that.

How do I decode URL-encoded JSON back to normal?

In JavaScript, use decodeURIComponent(). In Python, it is urllib.parse.unquote(). Most languages have an equivalent built-in. Or just paste the encoded string into any URL decoder tool online.

Is there a maximum size this tool can handle?

No hard limit on our end — your browser's memory is the only constraint. But keep in mind that the encoded output grows to about 3x the original size. If your encoded string exceeds a few thousand characters, most web servers will reject it in a URL. For big payloads, send it as a POST body instead.

What is the difference between encodeURI and encodeURIComponent for JSON?

encodeURI leaves characters like :, /, ?, and & alone because it assumes you're encoding a full URL. That is terrible for JSON — those characters appear everywhere in JSON strings. encodeURIComponent encodes everything except letters, digits, and a handful of safe punctuation. Always use encodeURIComponent when encoding JSON for a query parameter.

Share: