What the JSON Editor does
The JSON Editor is a single editing pane for JSON: you type or paste, and it checks syntax as you go, marking the line of the first error. Format, Minify and Sort keys rewrite the document in place, so you can keep editing the result instead of copying it between two boxes.
Using the JSON Editor
- Type or paste JSON into the editor. It is checked as you type; the status line and a highlighted line show the first problem.
- Format, Minify and Sort keys rewrite the document in the editor itself, so you can keep editing the result.
- Validate checks without changing anything.
JSON Editor example
The built-in sample
Input
{"name":"Ada Lovelace","active":true,"tags":["math","code"],"address":{"city":"London"}}Output
{
"name": "Ada Lovelace",
"active": true,
"tags": [
"math",
"code"
],
"address": {
"city": "London"
}
}This is the input that the Load sample button fills in.
Each output was produced by running this tool on the input above it.
How it works
About a third of a second after you stop typing, the text is sent to a Web Worker and parsed. Format re-writes it with the indentation chosen in the dropdown, Minify removes the whitespace between tokens, and Sort keys rebuilds every object with its keys in order. If the document is not valid, these buttons change nothing and the first error is shown.
Details and limits
- While you type, the document is only checked. It is rewritten when you press Format, Minify or Sort keys, so a half-finished edit is never reformatted under your cursor.
- Sort keys uses the same ordering as the JSON Sorter: by character code, at every depth, with arrays left in place.
- Download saves the current text of the editor as a
.jsonfile, whether or not it is valid at that moment. - Input that is not valid JSON stops the tool, and the status line shows where the problem is. The JSON Validator page lists the usual causes.
Questions
Is my data uploaded when I use JSON Editor?
No. The tool runs in your browser, so what you paste or open is processed on your own device and is not sent to a server.
What does JSON Editor do?
The JSON Editor is a single editing pane for JSON: you type or paste, and it checks syntax as you go, marking the line of the first error. Format, Minify and Sort keys rewrite the document in place, so you can keep editing the result instead of copying it between two boxes.
How does JSON Editor work?
About a third of a second after you stop typing, the text is sent to a Web Worker and parsed. Format re-writes it with the indentation chosen in the dropdown, Minify removes the whitespace between tokens, and Sort keys rebuilds every object with its keys in order.
Are there any limits I should know about?
While you type, the document is only checked. It is rewritten when you press Format, Minify or Sort keys, so a half-finished edit is never reformatted under your cursor. Sort keys uses the same ordering as the JSON Sorter: by character code, at every depth, with arrays left in place.
Is there a size limit?
There is no fixed size limit. Everything happens on your device, so very large inputs depend on its memory and can take longer on a phone than on a computer.
Does it work on phones, and is it free?
Yes. It works in any current browser on Android phones, iPhones, tablets and computers. It is free and needs no account or sign-up.