jq will sort (-S) the whole file (.) and compare STDOUT (<()) with diff diff <(jq -S . A.json) <(jq -S . B.json) https://stackoverflow.com/questions/31930041/using-jq-or-alternative-command-line-tools-to-diff-json-files