JSON Minifier Online Tool



About JSON Minifier Online Tool:

This online json minifier tool helps you to minify raw JSON string to save space to transmit faster cross Internet.

comic json minifier

Basic idea of JSON:

Simply put, JSON can convert a set of data represented in a JavaScript object into a string, then you can easily pass the string between functions, or pass the string from the web client to the server in an asynchronous application. This looks a bit odd, but JavaScript makes it easy to interpret, and JSON can represent a lot more complex data structure than "name/value pairs." For example, you can represent arrays and complex objects, not just simple lists of keys and values.

Does Json Minifier Online Tool log my data?

Absolutely NOT, this JSON Minifier doing all the work on the client side, all logic are implemented by Javascript. There are 2 major advantages: 1.Your data never transmitted in the Open Internet, so you know it's secure; 2.It's much faster than doing all the work in the server side, because there is no Internet Delay.

More information about JSON (JavaScript Object Notation):

RFC 8259 (JSON): https://tools.ietf.org/html/rfc8259

Python Implementation of JSON: https://docs.python.org/3/library/json.html

Java Implementation of JSON (GSON): https://github.com/google/gson

JSON Minifier with Python (with build-in package JSON):

import json


def minify_json(str):
    resultStr = json.dumps(json.loads(str), ensure_ascii=False)
    return resultStr
    

JSON Minifier with Java (with package GSON):

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;


public String minify(String jsonStr){
    JsonParser parser=new JsonParser();
    JsonElement je=parser.parse(jsonStr);
    Gson gson=new GsonBuilder().serializeNulls().create();
    return gson.toJson(je);
}