I've got some JSON data, but it's all on one line. Does anyone know of a web or Windows editor that will format (e.g. indent and insert new lines) this data for me, so I can read it better? Preferably one that uses a GUI to display the JSON—instead of a command-line tool that outputs a reformatted document, for example.
-
**See Also:** http://stackoverflow.com/questions/998832 – dreftymac Feb 12 '10 at 04:20
-
http://jsonlint.com/ can be used. – Kruti Patel Dec 14 '15 at 06:56
-
https://www.w3dnetwork.com/json-formatter.html -- is simple, and with multiple views, also as they claim they do not store any data , so you can use it to format sensitive data also. – Rahul Mukherjee Jan 25 '19 at 20:21
-
Have you tried this? https://devtoolsonline20190908040816.azurewebsites.net/DevTools/Prettify_JSON – GomuGomuNoRocket Sep 10 '19 at 15:07
-
you can download this extention for google chrome and it fill format your json:https://chrome.google.com/webstore/detail/json-formatter/bcjindcccaagfpapjjmafapmmgkkhgoa/related?hl=en – Mounir bkr Oct 01 '22 at 13:23
8 Answers
I have recently created JSON Editor Online, a tool to easily edit and format JSON online. JSON is displayed in a clear, editable treeview and in formatted plain text.

- 6,602
- 3
- 38
- 58
-
Haha. It's great. Before I found yours, my attempt was chrome dev tools > js console > write var x = *my_json*. Then I explore it the geeks way :P – asakura89 Aug 31 '12 at 03:30
-
-
-
I tried your tool an it's very nice. But, it will not validate valid JSON where there is a mutilined string assignment. The string has to be continuous without line breaks. – A.G. Nov 09 '13 at 17:28
Have you tried this?

- 97,670
- 29
- 122
- 130
-
formatter only -- it doesn't help you edit ( no syntax highlight or anything ) – Nick Perkins Aug 14 '11 at 20:44
-
-
i think that this is better https://devtoolsonline20190908040816.azurewebsites.net/DevTools/Prettify_JSON – GomuGomuNoRocket Sep 10 '19 at 15:07
-
1https://www.devprimetools.com/json-viewer - It supports search/filter in JSON. You can also view your JSON in a tabular/diagrammatic format. It has features like fetch data from REST API and saving JSON for future use. – Kanchan Kumar Apr 10 '20 at 06:49
-
You can download http://www.thomasfrank.se/json_editor.html and run it locally on your own data, although it is an editor rather than a formatter.
http://www.jsonlint.com/ is also a useful validation and reformatting tool.

- 1,159
- 6
- 6
On windows I go for: http://jsonviewer.codeplex.com/
Handy for pulling raw JSON responses from Firebug and parsing it for me.

- 51
- 1
- 3
I use http://curiousconcept.com/jsonformatter to format computer generated jsons. It makes it much readable.

- 1,875
- 1
- 19
- 28
-
1pretty good -- shows you exactly where your syntax is wrong ( but not as-you-type, only when you click to "process" button ) – Nick Perkins Aug 14 '11 at 20:49
Remember that JSON is just a Javascript Object Literal with fancy clothes. You should be able to use any Javascript Beautifier to clean it up.

- 164,128
- 91
- 395
- 599
I like this one here: http://freeformatter.com/json-formatter.html
The validation process is flexible if your doc does not adhere to the RFC standards. It also creates a tree with collapsible nodes which is cool when you want to work in a small area of the json tree

- 18
- 3
Here's what I do: use the Aptana Eclipse Javascript Editor, which will check your syntax as you type. There's only one trick: you have to wrap your json in a tiny bit of javascript to make the whole thing a valid javascript file, and eliminate those red and yellow syntax errors.
So, the outer-most {}
becomes: x={};
( with all your json stuff in the middle ).
Now you just have to strip-off the x=
and the ;
before parsing as JSON.
I do this in a function that wraps the jQuery ajax function:
function get_json_file(url,options,callback){
var opts = {dataType:"text"};
opts.url = url;
$.extend(opts,options);
opts.success=function(data){
var json = data.substring(data.indexOf('{'),data.lastIndexOf('}')+1);
var obj = JSON.parse(json);
callback(obj);
};
$.ajax(opts);
}
It's a bit crazy, but it's worth it to effectively have a really good syntax-checking JSON editor in eclipse.

- 8,034
- 7
- 40
- 40