JSON Percent Encoder & Decoder
Encode JSON for safe use in URLs with percent-encoding, or decode percent-encoded JSON back to readable format
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
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.
{"status":"active","role":"admin"}
%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.
%7B%22page%22%3A2%2C%22limit%22%3A50%2C%22sort%22%3A%22created_at%22%7D
{"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.
{"events":["order.created","order.paid"],"url":"https://example.com/hook"}
%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
Encoding JSON payloads into redirect URLs, OAuth state parameters, and callback query strings.
Decoding percent-encoded URLs from bug reports and server logs to see what data was actually sent.
Building webhook URLs and config strings where JSON must be embedded inside URL parameters.
Constructing test URLs with JSON query params for Postman, curl, or browser testing.
Common Mistakes
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.
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.
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
- Processing: 100% client-side (JavaScript
encodeURIComponent/decodeURIComponent) - Browser Support: Chrome, Firefox, Safari, Edge
- Size Increase: Expect 40–70% larger output — each special character goes from 1 byte to 3 bytes
- Unreserved Characters: A-Z, a-z, 0-9,
-_.~pass through unencoded
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.