51

I want to format JSON String in notepad++. Kindly guide me how to do so. I looked into this solution Notepad ++ JSON Format. It tells me to download the a tool from This web site. But I don't know which link to click out of 4 mentioned in that web site. Also, I just randomly downloaded one of the zip file and then unzipped it and it shows one dll file. Now what to do with that dll. Can some one guide me as I am a complete beginner. I have windows 10 running on my PC

EDIT 1 Some people are in so much hurry to give negative points. May be some people want to see code snippet even for this question. Huh!

EDIT 2 Anyways I tried below and IT DID NOT WORK

enter image description here

This is how my notepad ++ looks like after installing them.

enter image description here

EDIT 3 Ok I fixed the issue. The problem is if you select multiple plugins together (multiple checkboxes) and install them there seems to be some issue with notepad++, so the solution for me was to install the plugin individually.

Unbreakable
  • 7,776
  • 24
  • 90
  • 171

6 Answers6

25

You have to use the plugin manager of Notepad++ and search for the JSON plugin. There you can easily install it.

This answer explains it pretty good: How to reformat JSON in Notepad++?

Kiril
  • 6,009
  • 13
  • 57
  • 77
  • Can you kindly see my `EDIT 2` – Unbreakable Jul 24 '17 at 17:14
  • 2
    On their website http://www.sunjw.us/jstoolnpp/screenshots.php it's listen as `JSMin`. Just go with `JSTool`. That should be fine. Select the checkbox and then install it. – Kiril Jul 24 '17 at 17:19
  • Like I said I already did that. the screen shot is after installing those. – Unbreakable Jul 24 '17 at 17:21
  • Even after installing them I do not see any option related to JSON in the plugins dropdown of notepad++ – Unbreakable Jul 24 '17 at 17:22
  • 3
    Did you restart your notepad++? – Kiril Jul 24 '17 at 17:23
  • Yes it did that automatically. It had asked for a pop up. I selected YES to that. – Unbreakable Jul 24 '17 at 17:23
  • Are you sure the installation succeeded? Do you have admin right on your pc? – Kiril Jul 24 '17 at 17:26
  • Ok its working now. I selected all three checkbox and tried to install all of them. Turns our some sort of bug. One cannot install multiple plugins together. I checked just one plug in this time and installed it separately and now its working – Unbreakable Jul 24 '17 at 17:27
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/150014/discussion-between-unbreakable-and-kiril). – Unbreakable Jul 24 '17 at 17:27
23

Try with JSToolNpp and follow the snap like this then Plugins | JSTool | JSFormat.

enter image description here

A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103
  • 1
    Sucky part of this solution is that "JSFormat" also changes the language to JavaScript which comes with an ugly white font syntax format. It'd be nice if there was a way to tell "JSFormat" to change the language to JSON. – ryvantage Oct 29 '18 at 18:42
  • ryvantage: first of all, you confuse .json doc with "javascript language". javaScript is not a language by the way. You can switch between one-line minified json and format-json by going between JSTool->JSMin and JSTool->JSFormat. If you don't like whitespace, you can configure them with JSTool->Options. JSTool is beautiful, not ugly(Sucky?) like you said. – Jenna Leaf Sep 30 '19 at 14:41
18

Here are the steps to install JSToolNPP plugin on your Notepad++.

  1. Download 64bit version from Sourceforge or the 32bit version if you are on a 32-bit OS.

    64bit - JSToolNPP.1.21.0.uni.64.zip: Download from SourceForget.net
    
  2. Notepad++ before installation

does not show JSTool in the Plugins menu.

  1. Unzip the downloaded JSToolNPP.1.21.0.uni.64 and copy the JSMinNPP.dll and place it under C:\Program Files\Notepad++\plugins.

  2. Close Notepad++ and reopen it. If you have downloaded an incompatible dll, then it will complain, else it will open successfully. If it complains about incompatibility, go back to STEP 1 and download the correct bit version as per your OS. Check Plugins in Notepad++.

JSTool is now located in the Plugins menu.

  1. Paste a sample unformatted but valid JSON data in Notepad++.

  2. Select all text in Notepad++ (CTRL+A) and format using Plugins -> JSTool -> JSFormat.

NOTE: On side note, if you do not want to install any plugins like this, I would recommend using the following 2 best online formatters.

BSMP
  • 4,596
  • 8
  • 33
  • 44
JRG
  • 4,037
  • 3
  • 23
  • 34
  • I needed to create subdir and rename e.g. "/plugins/JSFormat/JSFormat.dll" (NPP 7.8.5). Unless the parent folder and DLL had the same name, the plugin was not found. – Mark Teese Apr 06 '20 at 12:17
2

Always google so you can locate the latest package for both NPP and NPP Plugins.

I googled "notepad++ 64bit". Downloaded the free latest version at Notepad++ (64-bit) - Free download and software. Installed notepad++ by double-click on npp.?.?.?.Installer.x64.exe, installed the .exe to default Windows 64bit path which is, "C:\Program Files".

Then, I googled "notepad++ 64 json viewer plug". Knowing SourceForge.Net is a renowned download site, downloaded JSToolNpp download@SourceForge.net. I unzipped and copied JSMinNPP.dll to notePad++ root dir.

I loaded my newly installed notepad++ 64bit. I went to Settings and selected [import plug-in]. I pointed to the location of JSMinNPP.dll and clicked open.

I reloaded notepad++, went to PlugIns menu. To format one-line json string to multi-line json doc, I clicked JSTool->JSFormat or reverse multi-line json doc to one-line json string by JSTool->JSMin (json-Minified)!

All items are in this picture.

Jenna Leaf
  • 2,255
  • 21
  • 29
1

The answer was to install the plugin individually. I installed all the three plugins shown in the screenshot together. And it created the issue. I had to install each plugin individually and then it worked fine. I am able to format the JSON string.

Unbreakable
  • 7,776
  • 24
  • 90
  • 171
  • check my answer, it requires you to place your dll in correct folder and Voila you are done!! – JRG Jul 24 '17 at 17:50
1

I was unable to find JSTool. Please see below url to see how I installed Notepad++

How to view Plugin Manager in Notepad++

I created JSMinNPP folder in C:\Program Files (x86)\Notepad++\plugins and copied JSMinNPP to it.

enter image description here

enter image description here

Ziggler
  • 3,361
  • 3
  • 43
  • 61