SmartQueryTools

Find Arg Max / Min in JSON Files Online

Find the value of one column at the row where another column is maximum or minimum in JSON files — directly in your browser. Optionally group by a category to get per-group results. No upload required.

How to find Arg Max / Min in JSON files

  1. Drop your file onto the upload area. The first 200 rows are shown. The second column is preselected as the one to find the max of, and the first column as the one to return.
  2. Choose the operation: arg_max for the row with the highest value, or arg_min for the lowest.
  3. Pick the "Find max of this column" and "Return the value of this column" columns. A sentence under the settings describes the query in plain words.
  4. Optionally pick a Group by column for one result per group, and name the output column. Left blank, it is named like date_at_max_temp.
  5. Click Find Arg Max (or Find Arg Min), check the result table, and download it as CSV.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A weather hobbyist logs daily readings from three stations and wants the date of the hottest day recorded at each one. One reading from Auckland failed and has no temperature.

Input (JSON)

[
  {
    "station": "WLG",
    "reading_date": "2026-01-14",
    "temp_c": 21.4,
    "rain_mm": 0
  },
  {
    "station": "WLG",
    "reading_date": "2026-01-15",
    "temp_c": 24.9,
    "rain_mm": 2.2
  },
  {
    "station": "AKL",
    "reading_date": "2026-01-14",
    "temp_c": 26.1,
    "rain_mm": 0.4
  },
  {
    "station": "AKL",
    "reading_date": "2026-01-15",
    "temp_c": null,
    "rain_mm": 5.8
  },
  {
    "station": "AKL",
    "reading_date": "2026-01-16",
    "temp_c": 25.3,
    "rain_mm": 0
  },
  {
    "station": "CHC",
    "reading_date": "2026-01-15",
    "temp_c": 29.8,
    "rain_mm": 0
  }
]

Settings

  • Operation: arg_max
  • Find max of this column: temp_c
  • Return the value of this column: reading_date
  • Group by: station
  • Output column name: left blank (auto-generated)

Result

stationreading_date_at_max_temp_c
AKL2026-01-14
CHC2026-01-15
WLG2026-01-15

For each station the tool finds the row with the highest temp_c and returns its reading_date. Auckland's failed reading has no temperature, so it is skipped and 26.1 on 14 January wins. The output has one row per station, sorted by station, and the column name is built from the chosen columns because none was typed.

Working with JSON files

Each top-level key is a column you can compare or return. Objects that are missing the value key, or have it set to null, are skipped. When the value key holds numbers in some objects and strings in others, it can load as text, and the comparison becomes alphabetical, so make sure the source sends one type. Booleans can be compared, with true ranking above false, and a returned boolean key keeps its value in the CSV as true or false.

A common use is finding the most recent record per id in an API export: find the max of updated_at, return status, group by id. ISO timestamp strings sort correctly even when compared as text, as long as they all use the same format and time zone. Nested objects can be returned but not compared, so flatten them first if the value you need to rank is inside one. The result is a CSV, not JSON.

Frequently Asked Questions

Can I find the latest status per record in a JSON export?

Yes. Use arg_max on the updated_at key, return the status key, and group by the record id.

Do ISO date strings in JSON compare correctly?

Yes, if they share the same format and offset. ISO dates sort in time order even as text. Mixed formats or offsets can give wrong results.

What happens when two rows tie for the maximum?

One of them is returned, and which one is not guaranteed. If ties matter, use Top N per Group or the SQL workspace to see every tied row.

How are NULL values handled?

Rows where either the value column or the returned column is NULL are skipped. If every row in a group is skipped, that group's result is empty.

Can I return the maximum value itself?

Choose the same column in both pickers and arg_max returns the maximum, but the Aggregate tool is the simpler way to get max and min values.

Related Tools