JSON Debugging

JSON Number Precision Guide

Prevent JSON integer and decimal precision loss across JavaScript, APIs and databases by choosing explicit string or decimal representations. Last updated September 30, 2026.

Prevent JSON integer and decimal precision loss across JavaScript, APIs and databases by choosing explicit string or decimal representations. This reference is written for developers who need practical validation behavior, reviewable rules and safe examples rather than copied snippets with no explanation.

Recommended workflow

StepWhy it matters
Classify the valueSeparate identifiers, counters, money and scientific measurements before selecting a representation.
Check every consumerCompare numeric ranges and decimal behavior in JavaScript, backend languages and databases.
Choose a contractTransport oversized integers or exact decimals as documented strings when necessary.
Round-trip testSerialize, parse, persist and return boundary values without relying on visual similarity.

Starter snippet

unsafe JS integer: 9007199254740993   safer transport: "9007199254740993"

Review checks

Common mistakes

Validation should help users correct input while protecting systems from bad data. Keep syntax checks, product policy, security review and deliverability checks separate.

Related Formalint references

Continue with Developer Data Validation Guide, Json Schema Guide, API Schema Drift Debugging.