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

Keep or Drop JSONL Fields

updated 16 August 2026

Projection for JSONL — the SELECT id, email of newline-delimited JSON. Name the fields you want and get records containing only those, or name the ones you don't and get everything else. Dotted paths reach into nested objects, and the status bar reports the byte savings, which on a log export is usually most of the file.

Project fields

Drop a .jsonl file here, or Up to 1 GB · in your browser

Keep versus drop, and why the choice matters

Keep is an allowlist. Anything you did not name is gone, including fields you did not know were there. That is the right mode when the file is going somewhere it shouldn't carry surprises — a shared fixture, a third-party API, a dataset you're publishing. New fields added upstream will never leak through.

Drop is a denylist. Everything survives except what you named, which is right when you know exactly what the problem field is — a bearer token, a 1,536-float embedding, a base64 blob. It is the wrong mode for redaction, because a field you have not thought of is a field you have not removed.

Paths, order and shape

Paths are dotted: user.email reaches one level in, messages[0].content indexes an array. In keep mode the output record is rebuilt with the nesting intact, so keeping user.email gives you {"user":{"email":"…"}}, not a flattened {"user.email":"…"} — for that, use Flatten first.

Key order in keep mode follows the order you listed the fields, which makes the output easy to scan and stable across runs. Drop mode preserves each record's original order. Records that are not objects — a bare string or number on a line — are passed through untouched rather than silently emptied.

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

Is this a substitute for redacting PII?

Keep mode is a reasonable structural control — if you never keep the field, it never ships. But PII hides inside values as well as behind field names, and a free-text notes field you kept may contain an email address. Use the Anonymizer for value-level redaction, and this for structure.

Can I reorder fields without removing any?

Yes — keep mode with every field listed in the order you want. Anything you forget will be dropped, so check the record count and byte delta afterwards.

Why did my file barely shrink?

Because the bulk was in the fields you kept. Run Field coverage to see which keys are present and Truncate to find out where the bytes actually are — it is usually one long string field, not many small ones.

Does it work on a JSON array rather than JSONL?

Convert first with JSON to JSONL, project here, and convert back with JSONL to JSON if you need the array shape.

Related tools