JSON Minifier Online
JSON Minifier or JSON Uglifier online tool is to compress JSON strings. This will remove indentation, unwanted spaces and convert the entire JSON to a single line of string. This JSON Minifier will minify JSON in browser and will not send data to server. JSON is linted while processing the data to provide errors in the JSON.
To format ION string data, then please uncheck validate/lint JSON options in the option tab.
Why JSON is minified ?
JSON minifier is required while transferring data over network to save network bandwith and while persisting data in store or logs to save memory/space. Also it will be easy to put configurations for applications in single while reading it from file.
How to minify JSON using Javascript?
You can use Javascripts JSON.parse
and JSON.stringfy
methods to compress JSON and remove spaces and empty lines.
const json_object =`[{ "name": "facia", "message": "welcome"}]`
// Parses JSON, throws error if it is not a valid JSONconst json_parsed = JSON.parse(json_object);
// Minfies the JSONconst json_string = JSON.stringfy(json_parsed)
If you need to convert minified JSON back to beautiful or formatted JSON check our - JSON Formatter Online Tool.