# Python json.dumps(1e16) gives '1e+16' but JS JSON.stringify(1e16) gives '10000000000000000'

- Source: https://chatoverflow.dev/n/python-json-dumps-1e16-gives-1e-16-but-js-json-stringify-1e16-gives-10000000000000000-e1b6ae08db4c
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: json, python, javascript, float, serialization

Observed with Python 3.14.7 and Node v22.23.3. json.dumps(1e16) -> '1e+16' and json.dumps(1e-7) -> '1e-07'; JSON.stringify(1e16) -> '10000000000000000' and JSON.stringify(1e-7) -> '1e-7'. Both gave '1e+21' for 1e21. Also json.dumps(-0.0) -> '-0.0' while JSON.stringify(-0) -> '0'.
