A JSON Lines export can contain several valid records while a JSON formatter rejects the whole paste. Check the export format before adding commas or wrapping everything in brackets. Those changes produce a different container and may break the receiving workflow.
The JSON Formatter and Validator accepts one JSON value per run. Use it to inspect an individual record, then return a compact version to a separate working copy of the JSON Lines sample.
Recognize the boundary between records
The JSON Lines format documentation requires UTF-8 text with one valid JSON value on each physical line. This fictional two-event sample has two records:
{"event":"note", "id":"E-41", "message":"First line\nSecond line"}
{"event":"done", "id":"E-42", "ok":true}
The visible \n inside the message is an escape sequence, not a physical line break in the file. After JSON parsing, that message contains a newline character. RFC 8259 describes a JSON text as one serialized value and defines escapes for control characters inside strings.
Save the original export before experimenting. Check the producer or importer documentation for the expected format; a filename alone does not establish the contract. Do not convert JSON Lines into an array merely to obtain a formatter success message.
Inspect one complete line as a readable copy
- Copy the entire first physical record, from its opening brace through its closing brace. Keep its original line number in your notes.
- Paste that line into Paste your JSON. Choose 2 spaces under Indent.
- Leave Minify and Sort keys alphabetically unchecked. Press Format JSON.
- Compare the field names, string IDs and message with the original record.
The current formatter produces this readable display copy:
{
"event": "note",
"id": "E-41",
"message": "First line\nSecond line"
}
This is one valid JSON object spread over five physical lines. It is useful for review, but pasting those five lines into a JSON Lines file would violate its per-line record boundary.
If the selected record fails, repair that record from its original source. A line number reported for the selected paste refers to that paste, so retain the original file line number separately. When ordinary JSON syntax is the problem, use the JSON syntax repair guide.
Return a compact record to the working sample
With the first record still in the input, check Minify and press Format JSON again. The output becomes:
{"event":"note","id":"E-41","message":"First line\nSecond line"}
Replace only that record in the working sample. Repeat the same process for the second record, keeping its position. The resulting two-record sample is:
{"event":"note","id":"E-41","message":"First line\nSecond line"}
{"event":"done","id":"E-42","ok":true}
The formatter uses JavaScript parsing and serialization. JSON.stringify controls formatting whitespace through its spacing argument; this does not remove spaces or newline characters from parsed string values. This sample retains both IDs, the boolean and the newline inside the message.
Rebuilding is not byte preservation. JSON.parse can lose numeric precision, and duplicate keys can disappear during parsing. Keep signed payloads and precision-sensitive exports in a workflow suited to their requirements. The current tool does not offer a bulk JSON Lines import mode.
Check the saved sample one record at a time
For this example, confirm two records in order: E-41, then E-42. Check each complete physical line with a JSON parser, and compare the recovered field values with the original. Reopening the sample should show no pretty-print indentation between records and no extra blank line.
A blank physical line is not a JSON Lines value. A single line terminator after the last record is allowed and recommended; it is different from inserting an empty line between records. Do not silently discard a failing line during validation: record its number and resolve it against the producer specification.
A local independent line-by-line parsing check accepted both shown two-record samples and preserved their values. It rejected a blank line inserted between them and the five-line display copy used as a JSON Lines file. Check a real working copy with the intended importer as well, since syntax acceptance does not establish that its fields meet that importer contract.