Truncate JSONL
Cut a large JSONL file down to something you can actually work with. Cap the number of records, truncate long string values, limit array length, and collapse nesting past a chosen depth. The status bar reports exactly what was cut and how many bytes you saved.
Truncate
Which limit to reach for
- Max records — the blunt one, and usually the right first move. 100 records keep the file's shape while making it readable.
- Max chars per string — where the savings actually are in text-heavy data. A dataset of long documents shrinks by 95% at 200 characters per field and remains perfectly good for testing a parser.
- Max array length — for records carrying long embeddings or event lists. Note this changes the semantics: a 1,536-dimension vector cut to 8 is no longer a vector.
- Max depth — replaces anything deeper than the limit with a placeholder such as
{12 keys omitted}, which keeps the top-level shape legible while cutting the bulk.
Combine them. Records-then-strings is the usual pair, and it is normal to get a 200 MB file under 100 KB without losing anything you needed for a test.
Truncated data is for testing, not training
A truncated string is a damaged record. That is fine for exercising a parser, checking a schema, or committing a fixture — and wrong for anything that learns from the content: a model trained on mid-sentence cutoffs learns to stop mid-sentence.
When you need a smaller dataset that is still real, sample instead of truncating — Shuffle then take the first N, or use Sampler for a proportional subset. Every record then stays intact.
Privacy
Nothing is uploaded. The whole thing runs in this tab, in your own browser. That matters here more than on most tool sites — training data is usually the most sensitive file a team owns.
Frequently asked questions
Why is the ellipsis marker optional?
Because the … character makes truncation visible, which is what you usually want — but it also changes the string. Turn it off when byte-exact prefixes matter.
Does it truncate keys as well as values?
No, only values. Shortening a key would change the record's shape and break anything reading it. Use Minifier to drop whole keys instead.
Is the record order preserved?
Yes. Max records keeps the first N in file order. Shuffle first if you want a random subset.
Can it strip specific heavy fields instead?
That is the Minifier's remove-keys option — better when you know which field is the problem. Use this page when you do not, or when the bulk is spread across many fields.