JSON minifier
Remove all optional whitespace from JSON to make it as small as possible.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/json-minify \
-H 'Content-Type: application/json' \
-d '{"input":{"text":"{ \"a\": 1,\n \"b\": [1, 2] }"}}'
import json, urllib.request
body = {'input': {'text': '{ "a": 1,\n "b": [1, 2] }'}}
request = urllib.request.Request("https://setget.net/v1/tools/json-minify", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/json-minify", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"text":"{ \"a\": 1,\n \"b\": [1, 2] }"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "json-minify",
"input": {
"text": "{ \"a\": 1,\n \"b\": [1, 2] }"
}
}
{
"input": {
"text": "{ \"a\": 1,\n \"b\": [1, 2] }"
}
}
Endpoint: POST /v1/tools/json-minify. Over MCP: run_tool with slug: "json-minify".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
text |
string | yes | The JSON to minify. |
Example
Input
{
"text": "{ \"a\": 1,\n \"b\": [1, 2] }"
}Result
{
"text": "{\"a\":1,\"b\":[1,2]}",
"bytes_before": 25,
"bytes_after": 17
}Related tools
- JSON formatterPretty-print JSON with your choice of indentation, optionally sorting keys.
json-format - Gzip compress and decompressCompress text with gzip to base64 and see the size saved, or decompress base64 gzip data.
gzip - .env to JSONParse a .env file into a JSON object, handling quotes, comments and "export" prefixes.
env-to-json - CSV profilerSummarise each CSV column: type, blanks, distinct values, min, max, mean and top values.
csv-profile - CSV sort, filter and dedupeSort CSV by a column, keep rows containing some text, pick columns and remove duplicate rows.
csv-sort-filter-dedupe - CSV to JSONTurn CSV rows into a JSON array of objects, detecting numbers, booleans and blanks.
csv-to-json