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

JSONL Auto-Fixer

updated 4 May 2026

100% client-side. Your file never leaves this page.

Repair

Drop a .jsonl file here, or

JSONL Auto-Fixer

Paste a broken JSONL file. The fixer runs a pipeline of conservative repairs — trailing commas, single → double quotes, smart quotes, NaN/Infinity, BOMs, unquoted keys, comments, leading garbage — and returns a clean copy. Anything it can't fix is reported with the exact line, column, and a suggestion.

What it fixes

Every input line passes through this pipeline. Each step only touches the line if a transformation actually applies, and the final output is re-parsed before being accepted — so the fixer won't silently produce something that looks like JSON but isn't.

  1. Already-valid lines pass through unchanged. No edits when the line already parses.
  2. UTF-8 BOM at the start of a line — common when a file was saved from Notepad on Windows.
  3. Leading and trailing whitespace on each line.
  4. Leading garbage before the first { or [ (e.g. log prefixes, banner text).
  5. Smart / curly quotes “ ” ‘ ’ normalised to straight ASCII " '.
  6. JS-style comments// line and /* block */ stripped.
  7. NaN, Infinity, -Infinity, undefined replaced with null (these aren't valid JSON values, but JS often emits them).
  8. Single-quoted strings and keys rewritten to use double quotes, with embedded double-quotes escaped.
  9. Unquoted object keys like {id: 1} rewritten to {"id": 1}.
  10. Trailing commas before } or ] removed.

If a line still won't parse after all of that, the fixer leaves it out of the output and reports it in the error list with the column and a suggestion. It will never substitute a partially-broken record with a guess — silently corrupted data is worse than data you know is broken.

How to use it

  1. Paste the broken JSONL into the Input pane, or drop a .jsonl file onto the drop zone.
  2. Click Fix automatically. The repair pipeline runs over every line.
  3. The Output pane fills with cleaned JSONL; the What was fixed summary lists each transformation and how many lines it touched.
  4. Anything unfixable shows up in the error list with line, column, the offending source, and a suggested fix you can apply by hand.
  5. Click Download fixed or Copy to grab the cleaned file.

Example

Input — five common breakages on consecutive lines:

{"id":1,"ok":true}
{'id':2,'ok':true}
{"id":3,"ok":true,}
{"id":4,"score":NaN}
{id:5, ok:true}

Output:

{"id":1,"ok":true}
{"id":2,"ok":true}
{"id":3,"ok":true}
{"id":4,"score":null}
{"id":5,"ok":true}

What it deliberately won't do

Related tools

Frequently asked questions

Will this corrupt my data?

The fixer re-parses every line after applying transforms. If the result isn't valid JSON, the line is excluded from the output and reported as unfixable. It only emits lines that JSON.parse accepts.

Why are some lines reported as unfixable?

Repairs that require guessing — closing an unterminated string, inserting a missing comma between fields, recovering a truncated number — are intentionally left out. Open the offending line in your editor and fix it manually, then re-run.

Does this run on the server?

No. The repair logic is a pure JavaScript function that runs in your browser tab. Your data never leaves your machine.