Input

Mode:

Output

What Is JSON URL Encoding?

Ever tried to pass a JSON object as a GET query parameter and ended up with a broken URL? Characters like {, ", and : are not URL-safe. RFC 3986 defines which characters must be percent-encoded in a URL — curly braces, quotes, colons, and brackets all need encoding. JavaScript's encodeURIComponent() handles this for you. This tool does the same: paste your JSON (defined in RFC 8259), get the URL-safe encoded string back. It also decodes — paste a percent-encoded query param back to readable JSON. Useful when debugging Fetch API requests or working with REST APIs that accept JSON as GET params.

This tool has two modes: Encode and Decode. Toggle between them at the top. Both run in your browser; nothing is sent to a server.

How to Use This Tool

1

Choose Mode

Select Encode to URL-encode your JSON, or Decode to decode a URL-encoded JSON string back to readable JSON.

2

Paste Input

Paste your JSON or URL-encoded string into the left editor. Use Sample or Upload if needed.

3

Copy Result

The right panel updates automatically. Use Copy or Download to get the result. For validating JSON, try JSON Validator.

JSON URL Encode Examples

URL encoding converts special JSON characters to percent-encoded sequences. Example:

JSON input

Input

URL-encoded output

Output

When JSON URL Encoding Matters

When you need to pass JSON as a query parameter in a URL, JSON URL encoding is necessary. Raw JSON contains characters that are not URL-safe (like {, ", :), and including them unencoded will break the URL structure. APIs often require JSON parameters to be URL-encoded when using GET requests.

For encoding regular URLs (not JSON), use the URL Encoder tool instead.

Frequently Asked Questions

Which characters get percent-encoded in JSON URL encoding?

All non-URL-safe characters per RFC 3986: {%7B, }%7D, "%22, :%3A, [%5B, ]%5D, spaces → %20, and more. The tool uses encodeURIComponent() which encodes everything except letters, digits, and -_.!~*'().

Does the tool validate JSON before encoding?

It tries to validate your input as JSON. If it is valid, encoding proceeds cleanly. If not, the tool still encodes the raw string. In Decode mode, valid JSON is pretty-printed for readability.

Is my JSON data sent to a server?

No. Encoding and decoding run entirely in your browser using JavaScript. Nothing is uploaded or transmitted.

What is the difference between JSON URL encode and JSON escape?

JSON escape converts characters to \n, \" etc. for embedding inside JSON string values. URL encoding converts to %XX format so JSON can be passed safely in a URL. They solve different problems.

When do I actually need to URL-encode JSON?

Any time you pass JSON as a GET query parameter — for example https://api.example.com/search?filter=%7B%22name%22%3A%22John%22%7D. POST requests with Content-Type: application/json do not need URL encoding.

Related Tools

The URL encoding standard is defined in RFC 3986. MDN encodeURIComponent() documents the JavaScript function used. The JSON specification defines JSON syntax.