February 2026

Sort a JSON Object with jq

Trying to find stuff in unsorted JSON data can be a pain. A quick fix is to use jq to sort things.

jq --sort-keys . input.json > output.json

-a

end of line

References

Great little tool that's on my list of things to spend time getting better at.