[jq] Find the minimum value in an array

Created on November 30, 2026

Use min to return the smallest element in an array.

echo '[3,10,7]' | jq 'min'
3

Use min_by to select the object with the smallest value for a particular field. Here the key is .score.

echo '[{"name":"A","score":70},{"name":"B","score":90}]' | jq 'min_by(.score)'
{
  "name": "A",
  "score": 70
}

Reference

jq