[jq] Convert a JSON array to TSV

Created on November 30, 2026

Use @tsv to turn a jq array into a tab-separated row. Start with this JSON array of objects.

[
  {
    "name": "Taro",
    "age": 20
  },
  {
    "name": "Hanako",
    "age": 25
  }
]

For each object, collect the desired values into [.name, .age] and pass the array to @tsv. The -r option writes the row as plain text without JSON quotes.

echo '[{"name":"Taro","age":20},{"name":"Hanako","age":25}]' | jq -r '.[] | [.name, .age] | @tsv'

Output

Taro    20
Hanako  25
jq