Check every line of a JSONL file, turn JSON Lines into a JSON array or a JSON array into JSONL, and check the chat fine-tuning format. Nothing is uploaded.
A JSONL validator checks that every line of the text is valid JSON on its own, and this page lists each line that is not, with the line number and the column of the first problem. JSONL, also called JSON Lines, is one JSON value per line, so a line may be an object, an array, a string, a number, true, false or null. Worked example: the sample has 6 lines. Four are valid, one is blank and line 4 is missing a comma between two messages, which is reported as column 51. Blank lines are allowed by default and counted separately; switch Allow blank lines off to list each one as a problem. A final line break at the end of the text is not counted as a blank line. A byte order mark at the start is ignored, with a notice, and CRLF line endings are accepted.
JSONL to JSON array reads each line and writes one pretty-printed array with 2 space indentation, in the same order. A line that is not valid JSON is left out of the array and listed in the table, and the notice gives the count, so check it before you use the array. JSON array to JSONL does the opposite: it reads one JSON array and writes each item on its own line with no extra spaces. Line breaks inside strings stay escaped as \n, so every item is exactly one line. The top level has to be an array. To convert one object, wrap it in square brackets first. No final newline is added to the result. Numbers and key order are kept as the browser reads them, so a number with more than 15 significant digits can lose digits.
The check for the chat fine-tuning format is optional and runs on lines that are valid JSON. Each line must be an object with a messages array that is not empty. Each message must be an object whose role is system, user, assistant or tool, written in lower case, and whose content is a string, which may be empty. Every failure is listed with its line and the message position, for example messages[1].role must be system, user, assistant or tool. Up to 10 problems are listed per line. The check covers only those rules. It does not look at tool_calls, names, weights or images, it does not count tokens, and it does not check that the last message comes from the assistant, so also follow the documentation of the service you upload to.
Up to 1,000,000 characters are handled. The table shows the first 1,000 problems and says how many there are in total, and the stats count every line. A line nested deeper than 500 levels is reported as a problem. The messages are fixed sentences with numbers and keywords, so the text of your lines is never repeated in them. Everything runs in this tab, and above 100,000 characters the result follows your typing after a short pause.
Paste the file into the box with Validate JSONL selected. The result says how many lines are valid, and the table lists each bad line with its number and the column of the first problem. The sample has 6 lines and gives 4 valid lines, 1 blank line and 1 problem, which is the missing comma on line 4.
Choose JSONL to JSON array. Each line becomes one item of a pretty-printed array in the same order. Invalid lines are left out of the array and listed in the table, so fix them first if you need every line.
Choose JSON array to JSONL and paste an array such as [{"a":1},{"a":2}]. You get two lines, {"a":1} and {"a":2}. If your JSON is a single object, put it inside [ ] first.
By default it is not: blank lines are skipped and counted. Turning Allow blank lines off lists each blank line with its number, so you can remove them if the place you upload to does not accept them. A final line break at the end of the file is never counted.
That each line is an object with a non-empty messages array, and that every message has a role of system, user, assistant or tool and a content string. A line such as {"messages":[{"role":"bot","content":"x"}]} is reported as messages[0].role must be system, user, assistant or tool.
No. The text is processed in your browser and not uploaded. Only the option values, such as the mode and the switches, are saved in this browser, never the text.