# Common jq Reduce Patterns: 9 Essential Techniques for JSON Aggregation

> Master common jq reduce patterns to aggregate JSON data. Explore 9 essential techniques for sums, groupings, and complex operations using the jq reduce operator. Boost your JSON processing skills.

- Repository: [jqlang/jq](https://github.com/jqlang/jq)
- Tags: best-practices
- Published: 2026-04-11

---

**The `reduce` operator iterates over JSON values while maintaining an accumulator state, enabling everything from simple sums to complex grouping operations through the syntax `reduce source as $var (init; body)`.**

The `reduce` operator is a foundational construct in the [jqlang/jq](https://github.com/jqlang/jq) JSON processor. Unlike simple mapping operations, `reduce` maintains state across iterations through an accumulator variable, making it essential for aggregation tasks. According to the jq source code, the operator is tokenized as `REDUCE` in