JSON Validator for Notepad++?

16

2

I'm looking for a plugin that can check the current opened file and instantly tell me whether it is valid JSON or not (eg whether there's a comma or a bracket missing) — is there any? I'm currently using JSONView on Chrome but it's a pain to always go check the file in the browser and back.

I'm often writing data in json by hand, hence why I feel this could save me a lot of time.

Mahn

Posted 2012-07-08T23:29:56.700

Reputation: 742

Question was closed 2017-06-04T21:58:23.277

You can use Codverter JSON Validator: https://codverter.com/src/jsonvalidator it`s highly secure and everything you do is interpreted on your local computer and never sent back to the server. the validation error messages are informative and accurate. (Full Disclosure: I am one of the developers).

– jonathana – 2019-03-11T17:25:11.433

Not a plugin for Notepad++ but XML ValidatorBuddy is also a JSON editor and comes with a built-in JSON syntax checker and auto-completion. It is a standalone Windows tool. – Clemens – 2012-10-23T09:38:35.327

Answers

7

You might be able to use a JSON formatter to accomplish the task (since it would likely complain or do something wrong -- say, like indent improperly -- if the JSON's invalid). See Is there an extension to reindent JSON in Notepad++?. Similarly, there's a JSONViewer Notepad++ plugin the might help in the same way.

Another less-than-ideal alternative would be to just use one of the online JSON validators.

martineau

Posted 2012-07-08T23:29:56.700

Reputation: 3 849

It's worth noting that the JSONView Chrome extension does a great job but crashes on significantly large files (can't get it to process a 90meg file... not sure what it's limit is though). – Sean Colombo – 2016-02-18T17:04:00.000

+1 for JSON Viewer- I use it all the time. can also format/reindent your JSON string. Only thing is you have to manually use the functionality- I don't think you can do it every time a .json file is opened – Robotnik – 2012-07-09T00:16:01.043

Thanks, I upvoted, but it's still not quite what I hoped for; JSMin ignores errors, and JSON Viewer while it does fail if the json is not properly formatted, I still get much more if I parse it using JSONView in Google Chrome since as opposed to JSON Viewer it tells exactly what is missing and where. Oh well. I suppose I can only hope someday somebody able to code npp plugins comes across this and implements a simple one-button solution to parse and validate json. – Mahn – 2012-07-09T16:26:44.043

@Mahn: Thanks. Necessity is the mother of invention, so perhaps you should be that someone... – martineau – 2012-07-09T16:54:21.453

I'd love to, but I'm involved in a somewhat big project atm and time is ticking out :) maybe someday. – Mahn – 2012-07-09T19:56:40.740

2

There is plugin for NPP+ called JSLint. It is a plugin to validate JavaScript-code, but it works also just fine with JSON-files.

Michael

Posted 2012-07-08T23:29:56.700

Reputation: 21

2Does not seem to work for me. It says "JSLint can operate only on JavaScript, HTML or CSS files". Saving my .json file as .js file does not help. – Mikhail – 2017-01-14T14:02:36.930