Minify JSON

Remove whitespace from JSON to minimize file size and bandwidth.

Code

Utilities
import json
return json.dumps(json.loads(jsonStr), separators=(',', ':'))

Parameters

JSON string to minify.

Server

More Python Snippets