View My JSON
Skip to main content
Blog

How to compare two JSON files and find what actually changed

Compare JSON payloads by changed path instead of by line. Covers normalizing key order, jq and diff workflows, array pitfalls, and noisy fields.

You have a response from staging and a response from production, and one of them behaves differently. The files are 600 lines each, the keys come out in different orders, and a plain text diff lights up like a Christmas tree. Comparing JSON well means deciding what counts as a difference, normalizing the inputs, and then reading the result in terms of paths instead of lines. Here is a workflow that holds up.

Sources and further reading

Try the JSON workspace