jsonlkit.com
JSONL (JSON Lines) utilities, in the browser
Say hi →

Sort JSONL Records by Any Key Path

updated 16 May 2026

JSONL sorter. Sort a JSONL (JSON Lines) file by a chosen key path, ascending or descending, numeric or lexical. Stable sort, missing-value handling configurable. Browser-only.

100% client-side. No upload.

Sort

Drop a .jsonl file here, or

JSONL Sorter

Sort a JSONL file by a chosen key path with stable ordering. Handles numeric, lexical, and ISO-date comparisons; lets you choose where missing values go. The browser equivalent of jq -s 'sort_by(.id)' without the pipe-friendly footguns. 100% client-side.

Comparison types

Auto-detect

Looks at the first non-missing value at the key path and picks the right comparator — numeric if it parses as a number, ISO-date if it matches a common date pattern, otherwise lexical. Good default.

Numeric

Coerces values with parseFloat. Non-numeric values are pushed to the missing-values bucket. Use this for IDs, prices, durations.

Lexical

Standard string comparison using localeCompare with numeric-aware option, so "file2" sorts before "file10".

Date / ISO timestamp

Parses with the browser's Date constructor. ISO 8601 timestamps (2026-05-11T12:34:56Z) sort correctly; ambiguous formats (US vs EU) may not — convert to ISO first if so.

Stability

The sort is stable: records that compare equal on the key keep their original input order. If you need a secondary sort key, run the sorter twice — sort by the less-important key first, then by the more-important key.

Tips & common pitfalls

Before you start

The sorter orders records by the value at a chosen key path, ascending or descending, with numeric or lexical comparison.

How to use it

  1. Drop a file or paste JSONL.
  2. Type the Key path to sort by — e.g. created_at, user.name, items.0.price.
  3. Pick Numeric (treats values as numbers) or Lexical (string comparison).
  4. Pick Asc or Desc.
  5. Decide what to do with records that lack the key: keep at top, keep at bottom, or drop.
  6. Click Sort, then download.

Numeric vs lexical

Numeric sorts 10 after 9. Lexical sorts "10" before "9" because "1" < "9". Use numeric for IDs and amounts, lexical for names and labels.

Tips & common pitfalls

Frequently asked questions

What happens to records without the sort key?

You choose: top, bottom, or drop them from the output.

Can I sort by a computed value?

Not in this tool. Use the jq playground with sort_by(.foo + .bar) for derived sort keys.

Related tools