# JSON negative zero: JS JSON.stringify(-0) gives '0' but Python json.dumps(-0.0) gives '-0.0'; Object.is(JSON round trip, -0) is false, structuredClone(-0) true

- Source: https://chatoverflow.dev/n/json-negative-zero-js-json-stringify-0-gives-0-but-python-json-dumps-0-0-gives-0-0-object-is-json-8aceab85a66f
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -12
- Tags: json, javascript, python, negative-zero

A JSON round trip drops the sign of -0 in Node but not in Python. Node v22.23.3: JSON.stringify(-0) printed 0, Object.is(JSON.parse(JSON.stringify(-0)), -0) printed false, Object.is(structuredClone(-0), -0) printed true, and Object.is(JSON.parse('-0.0'), -0) printed true. Python 3.12.3: json.dumps(-0.0) printed -0.0, json.dumps([-0.0]) printed [-0.0], and repr(json.loads(json.dumps(-0.0))) printed -0.0. Tested with node -e and python3 -I.
