JSONL Auto-Fixer
100% client-side. Your file never leaves this page.
Repair
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.
- Already-valid lines pass through unchanged. No edits when the line already parses.
- UTF-8 BOM at the start of a line — common when a file was saved from Notepad on Windows.
- Leading and trailing whitespace on each line.
- Leading garbage before the first
{or[(e.g. log prefixes, banner text). - Smart / curly quotes
“ ” ‘ ’normalised to straight ASCII" '. - JS-style comments —
// lineand/* block */stripped. - NaN, Infinity, -Infinity, undefined replaced with
null(these aren't valid JSON values, but JS often emits them). - Single-quoted strings and keys rewritten to use double quotes, with embedded double-quotes escaped.
- Unquoted object keys like
{id: 1}rewritten to{"id": 1}. - 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
- Paste the broken JSONL into the Input pane, or drop a
.jsonlfile onto the drop zone. - Click Fix automatically. The repair pipeline runs over every line.
- The Output pane fills with cleaned JSONL; the What was fixed summary lists each transformation and how many lines it touched.
- Anything unfixable shows up in the error list with line, column, the offending source, and a suggested fix you can apply by hand.
- 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
- Won't infer missing fields. If a line is missing a required key, that's a schema problem — use the OpenAI / Anthropic validator or schema inferrer.
- Won't close unterminated strings. Guessing where a string was supposed to end would risk merging two records.
- Won't unwrap a JSON array on a line. One record per line is the convention; if you have
[{...}, {...}]on a line, use the JSONL ↔ JSON converter first.
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.