JSON URL Encoder
Percent-encode JSON so it can be passed safely in a URL or query string.
Input
Output
Ready
Drop a file to load it
About this tool
Percent-encode a JSON document so every reserved character survives being placed in a URL.
When you would use it
- Passing JSON as a query parameter
- Building a deep link that carries data
- Encoding a value for a redirect
Worked example
{
"id": 4815,
"name": "Ada Lovelace",
"active": true,
"score": 91.5,
"roles": ["admin", "editor"],
"address": { "city": "London", "postcode": "NW1" }
}
%7B%0A%20%20%22id%22%3A%204815%2C%0A%20%20%22name%22%3A%20%22Ada%20Lovelace%22%2C%0A%20%20%22active%22%3A%20true%2C%0A%20%20%22score%22%3A%2091.5%2C%0A%20%20%22roles%22%3A%20%5B%22admin%22%2C%20%22editor%22%5D%2C%0A%20%20%22address%22%3A%20%7B%20%22city%22%3A%20%22London%22%2C%20%22postcode%22%3A%20%22NW1%22%20%7D%0A%7D
Things worth knowing
- Component mode escapes the reserved characters
&,=,?,/and#, which is what you need inside a query value. - Long documents make for unwieldy URLs — most servers and browsers stop somewhere around 2,000 to 8,000 characters. Base64 in a request body is usually the better choice.
Questions
Frequently asked
What is the difference between the encoding modes?
Component mode escapes reserved characters and is right for a single query value. URI mode leaves
/, ? and # intact so a whole URL stays usable. Form mode encodes spaces as + for application/x-www-form-urlencoded bodies.Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Related