A common pattern when dealing with JSON data is to base64 encode binary strings. This is not strictly necessary, JSON strings can contain binary data (via UTF-8 escape sequences).
What is the size relationship for high-entropy (e.g. compressed) binary data?
>>> every_byte = ''.join([chr(i) for i in range(256)])
>>> import json
>>> import base64
>>> len(json.dumps(every_byte.decode('utf-8', 'replace')))
1045
>>> len(json.dumps(base64.b64encode(every_byte)))
346
What is the size relationship for high-entropy (e.g. compressed) binary data?
>>> every_byte = ''.join([chr(i) for i in range(256)])
>>> import json
>>> import base64
>>> len(json.dumps(every_byte.decode('utf-8', 'replace')))
1045
>>> len(json.dumps(base64.b64encode(every_byte)))
346