JSON Compare Online
A practical workflow for comparing two JSON payloads without letting whitespace hide the real changes.
Workflow
Format both JSON documents first, sort keys when the order is not meaningful, then compare the normalized output. This makes changed values and missing fields much easier to see.
Example
Before:
{"user":{"id":1,"role":"admin"}}
After:
{"user":{"id":1,"role":"editor"}}
Meaningful change:
user.role changed from admin to editorWhat to Watch
| Key / Code | Description |
|---|---|
| Object key order | Usually not meaningful in JSON APIs |
| Array order | Often meaningful, especially for ranked or ordered data |
| Number vs string | 42 and "42" are different values |
| Missing vs null | A missing key is not the same as a null key |
Related
Knowledge is power.