Skip to main content
Yoryantra
← Back to Tools

JSON Array Group By Tool

Group JSON records by escaped dot paths while keeping types and numeric summaries distinct.

Paste an array of objects from an API response, export, log sample, analytics report, or small dataset.

Grouping Settings

Use dot paths such as user.role. Escape a literal dot as \. and a backslash as \\.

Options

These options keep grouped output easier to inspect while still preserving enough detail for API responses, reports, and data cleanup.

Group counts are only meaningful when the key is unambiguous

Grouping sounds simple until the data contains nested fields, literal dots in member names, arrays, missing values, or a mix of strings and numbers that happen to look alike. The grouping key here is read as an escaped dot path: user.role walks into a nested object, while user\.role addresses a literal key named user.role.

Value types stay separate. The JSON number 1 and the JSON string "1" may look identical in a table, but they are not merged into one group. That matters when data came from different APIs, CSV imports, or loosely typed storage.

Nested paths without flattening the record

Records are grouped from their original structure. No flattened copy is created first, so a nested path cannot silently overwrite a literal dotted member name. Array indexes can be addressed with paths such as items.0.status.

Joined arrays are deliberately marked as lossy

Keeping an array as JSON text preserves its boundaries. Joining array items into display text can make different arrays collapse to the same label, especially when values contain the separator. Leave the joined-array option off when exact grouping matters.

Numeric summaries count numeric observations, not group rows

An average is calculated from the finite numeric values actually found in the selected numeric field. Missing, string, null, and non-finite values are not added to the denominator. A group with ten records but only six numeric observations therefore divides the sum by six, not ten.

Sum, minimum, maximum, and average are descriptive summaries only. They do not coerce numeric-looking strings such as "42". If the source uses strings for numbers, normalize that data deliberately before treating it as numeric.

Missing, empty, and null values need a policy

A missing path, an explicit JSON null, and an empty string are all treated as unavailable for the group key, then handled by the selected missing-value policy. They can be collected under a visible label or skipped. Percentages are calculated from the records that remain after that choice.

Grouped JSON can retain source records for inspection. If the 25-record cap is enabled, counts still describe the full group while the embedded record sample is truncated; a note makes that distinction visible.

JSON itself has a few interoperability boundaries

Duplicate object member names are rejected before grouping because different JSON parsers can disagree about which duplicate wins. Integers that JavaScript cannot represent safely are also stopped before they can be rounded. RFC 8259 recommends unique object names and notes that interoperable number handling is constrained by implementation limits.

Primary reference: RFC 8259 — The JavaScript Object Notation (JSON) Data Interchange Format

A small example with a nested field

[
  {"user":{"role":"editor"},"views":12},
  {"user":{"role":"editor"},"views":"9"},
  {"user":{"role":"viewer"},"views":7}
]

Group path: user.role
Numeric field: views

editor  → count 2, numeric values used 1, sum 12
viewer  → count 1, numeric values used 1, sum 7

Browser-side limits are part of the result

Parsing, grouping, sorting, and export happen in the current browser tab; pasted JSON is not sent to a Yoryantra server by the page code. Large arrays still consume local memory because the full document and group map must exist at once. For very large datasets, a database aggregation, dataframe, or streaming script is a better fit than a browser textarea.