Tools

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

JSON Percent Encoder & Decoder

Encode JSON for safe use in URLs with percent-encoding, or decode percent-encoded JSON back to readable format

Your files never leave your browser
Input0 chars, 0 lines
Output0 chars, 0 lines
Ready·

Paste raw JSON, hit Encode, and get a URL-safe percent-encoded string you can drop straight into query parameters, OAuth state fields, or webhook configs. Flip it around with Decode to turn %7B%22key%22%3A%22value%22%7D back into readable, pretty-printed JSON. And everything runs in your browser. Nothing gets uploaded.

How It Works

Paste JSON
➔
encodeURIComponent()
➔
URL-Safe String

The encoder scans each character in your JSON. Letters, digits, hyphens, underscores, periods, and tildes pass through untouched. Everything else — curly braces, square brackets, quotes, colons, spaces — gets converted to a percent sign followed by two hex digits. { becomes %7B, a double quote becomes %22. Decoding reverses the process exactly, and if the result is valid JSON, the tool pretty-prints it automatically.

Examples

Passing a Search Filter in a URL

Your app stores search filters as JSON in query params so users can share filtered views.

INPUT
{"status":"active","role":"admin"}
OUTPUT
%7B%22status%22%3A%22active%22%2C%22role%22%3A%22admin%22%7D

Decoding a Query String from Server Logs

You pulled a URL from your access logs and the query param is an unreadable wall of percent codes. Paste it in, hit Decode, get readable JSON back.

INPUT
%7B%22page%22%3A2%2C%22limit%22%3A50%2C%22sort%22%3A%22created_at%22%7D
OUTPUT
{"page":2,"limit":50,"sort":"created_at"}

Embedding API Config in a Webhook URL

A third-party service needs you to pass JSON config as a URL parameter in the webhook registration field. No room for raw braces.

INPUT
{"events":["order.created","order.paid"],"url":"https://example.com/hook"}
OUTPUT
%7B%22events%22%3A%5B%22order.created%22%2C%22order.paid%22%5D%2C%22url%22%3A%22https%3A%2F%2Fexample.com%2Fhook%22%7D

Who Uses This

👨‍💻 Backend Developers

Encoding JSON payloads into redirect URLs, OAuth state parameters, and callback query strings.

🔎 QA Engineers

Decoding percent-encoded URLs from bug reports and server logs to see what data was actually sent.

🚀 DevOps

Building webhook URLs and config strings where JSON must be embedded inside URL parameters.

📚 API Integrators

Constructing test URLs with JSON query params for Postman, curl, or browser testing.

Common Mistakes

Using encodeURI instead of encodeURIComponent

encodeURI leaves characters like :, /, ?, and & untouched. That's fine for a whole URL, but it will wreck JSON inside a query param because colons and ampersands still have URL meaning. Always use encodeURIComponent for data values — which is exactly what this tool does.

Encoding already-encoded strings (double encoding)

If your string already contains %7B and you encode it again, that percent sign becomes %257B. Now the server decodes it once and gets %7B as literal text instead of {. Check whether your input is raw JSON or already encoded before hitting Encode.

Forgetting to decode before parsing

Trying to JSON.parse() a percent-encoded string will throw a syntax error every time. You need to run decodeURIComponent() first, then parse. Sounds obvious, but it is one of the most common Stack Overflow questions about URL-encoded JSON.

Technical Details

Frequently Asked Questions

What is JSON percent-encoding?

It is the process of replacing characters in JSON that aren't safe for URLs with percent codes. A left curly brace { becomes %7B, a double quote becomes %22, and so on. The result is a string you can drop into a URL parameter without breaking anything.

Why can't I just put raw JSON in a URL?

URLs reserve characters like ?, &, =, #, and / for structural purposes. JSON is full of characters that overlap with these — braces, colons, quotes. A browser or server seeing & in a query string treats it as a parameter separator, not as part of your data. Percent-encoding removes that ambiguity.

What's the difference between encodeURI and encodeURIComponent?

encodeURI is meant for encoding a full URL — it leaves structural characters like /, :, and ? alone. encodeURIComponent encodes everything except letters, digits, and a few safe symbols. For JSON inside a query parameter, you always want encodeURIComponent. Using encodeURI on JSON will leave colons and slashes unescaped, which corrupts the URL.

Does percent-encoding make my JSON larger?

Yes. Each encoded character grows from 1 character to 3 (like " to %22). A typical JSON string will be 40–70% larger after encoding. Plain letters and numbers don't change, so the more alphanumeric your values are, the less size increase you'll see.

Is this tool safe for sensitive data?

Your data stays in your browser the entire time. Nothing is sent to a server — the encoding and decoding happen with built-in JavaScript functions on your device. You can disconnect from the internet and the tool still works. That said, percent-encoding is not encryption. The encoded string is trivially reversible, so don't confuse it with any form of security.

Share: