Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Json format to unbeautify json [closed]

Tags:

json

I have a beautified Json object and i would like to unbeautify it so i can use it in hard coding.

There are plenty of tools to beautify a json but none that would reverse. My problem is that i am not able to reverse the json object after beautifying it--- also known prettify.

I have already tried looking up if there would be any tool or site that will do this but was not successful.

Here is a sample of the json object i currently have:

"itemsList": [{
        "name": "Name",
        "type": "1"
    }]
like image 974
J.Doe Avatar asked Aug 31 '25 22:08

J.Doe


2 Answers

You can use JSONLint's reformat parameter: https://jsonlint.com/?reformat=compress.

This can even be chained with the json parameter to pass through your JSON directly:

https://jsonlint.com/?reformat=compress&json={"itemsList": [{ "name": "Name", "type": "1" }]}
like image 79
Obsidian Age Avatar answered Sep 04 '25 22:09

Obsidian Age


You can do the following.

  1. Open Notepad++.
  2. Use Ctrl+H and enable regular expression search
  3. Find "^\s{2,}" and replace it with ""
  4. Find "\n" and replace it with ""
like image 37
RKS Avatar answered Sep 04 '25 21:09

RKS