KKitForma.

Language

EnglishEnglishTürkçeTurkishDeutschGermanBlog unavailable in this language · open toolsEspañolSpanishBlog unavailable in this language · open toolsFrançaisFrenchBlog unavailable in this language · open toolsPortuguêsPortugueseBlog unavailable in this language · open toolsItalianoItalianBlog unavailable in this language · open toolsNederlandsDutchBlog unavailable in this language · open toolsPolskiPolishBlog unavailable in this language · open toolsРусскийRussianBlog unavailable in this language · open toolsУкраїнськаUkrainianBlog unavailable in this language · open toolsSvenskaSwedishBlog unavailable in this language · open toolsNorskNorwegianBlog unavailable in this language · open toolsDanskDanishBlog unavailable in this language · open toolsSuomiFinnishBlog unavailable in this language · open toolsČeštinaCzechBlog unavailable in this language · open toolsRomânăRomanianBlog unavailable in this language · open toolsΕλληνικάGreekBlog unavailable in this language · open toolsالعربيةArabicBlog unavailable in this language · open toolsעבריתHebrewBlog unavailable in this language · open toolsفارسیPersianBlog unavailable in this language · open toolsاردوUrduBlog unavailable in this language · open toolsहिन्दीHindiBlog unavailable in this language · open toolsবাংলাBengaliBlog unavailable in this language · open toolsதமிழ்TamilBlog unavailable in this language · open toolsతెలుగుTeluguBlog unavailable in this language · open toolsमराठीMarathiBlog unavailable in this language · open toolsગુજરાતીGujaratiBlog unavailable in this language · open tools简体中文Chinese SimplifiedBlog unavailable in this language · open tools繁體中文Chinese TraditionalBlog unavailable in this language · open tools日本語JapaneseBlog unavailable in this language · open tools한국어KoreanBlog unavailable in this language · open toolsTiếng ViệtVietnameseBlog unavailable in this language · open toolsไทยThaiBlog unavailable in this language · open toolsBahasa IndonesiaIndonesianBlog unavailable in this language · open toolsBahasa MelayuMalayBlog unavailable in this language · open toolsFilipinoFilipinoBlog unavailable in this language · open toolsKiswahiliSwahiliBlog unavailable in this language · open toolsAfrikaansAfrikaansBlog unavailable in this language · open toolsMagyarHungarianBlog unavailable in this language · open toolsБългарскиBulgarianBlog unavailable in this language · open toolsHrvatskiCroatianBlog unavailable in this language · open toolsSrpskiSerbianBlog unavailable in this language · open toolsSlovenčinaSlovakBlog unavailable in this language · open toolsSlovenščinaSlovenianBlog unavailable in this language · open toolsLietuviųLithuanianBlog unavailable in this language · open toolsLatviešuLatvianBlog unavailable in this language · open toolsEestiEstonianBlog unavailable in this language · open toolsCatalàCatalanBlog unavailable in this language · open toolsEuskaraBasqueBlog unavailable in this language · open tools

Code & data

JSON Lines or a JSON array: identify an export before you repair it

Diagnose an extra-data parse error with two synthetic event records, keep line boundaries meaningful and choose the format your importer actually accepts.

Read the first two complete records

A log export may contain one complete object on each line. Pasting the whole file into a formatter for one JSON document can fail after the first object, even though each individual line parses. That error is useful evidence of a format mismatch. It does not mean the exporter must have lost punctuation.

The JSON Lines convention uses UTF-8 and one valid JSON value per line. A blank line is not a value; a final line terminator is allowed. A JSON array instead has one enclosing pair of brackets and commas between its elements. File extensions help identify a candidate format, but the contents and exporter documentation decide.

JSON Lines:
{"event":"opened","item":"R-7"}
{"event":"saved","item":"R-7"}

One JSON array:
[{"event":"opened","item":"R-7"},{"event":"saved","item":"R-7"}]

JSON Lines format documentation ↗RFC 8259: JSON grammar ↗

Distinguish a value from its display lines

For this two-event sample, each object is also one physical line. A string containing the escaped sequence \n does not create another physical record. Conversely, pretty-printing one object across several physical lines breaks the one-value-per-line layout expected by a JSON Lines reader.

Do not use a line counter to determine the number of values in an arbitrary JSON array. An array can occupy one line or many. For a JSON Lines file, count successfully parsed values after checking every record; a raw line count cannot detect an invalid object or a stray blank line in the middle.

One physical JSON Lines record:
{"note":"first line\nsecond line"}

Its note value contains a newline after parsing.

Make a tiny sample without truncating a value

Keep the original export. Copy two complete harmless records into a working file and document the expected number of values. KitForma JSON Formatter can inspect each JSON Lines record individually, or inspect the entire array version. It is not a streaming JSON Lines importer and does not automatically wrap multiple objects.

If the receiver accepts only arrays, use a format-aware conversion that parses each line and writes one array. Test that conversion for value types, Unicode and numeric precision. Blindly replacing every line break with a comma can corrupt strings or produce empty elements. Large files need a streaming or bounded-memory workflow appropriate to their size.

  1. Check the export format in its producing application.
  2. Select two complete records with no private data.
  3. Validate each record and confirm the expected count.
  4. Import the sample using the receiver’s documented format.
  5. Compare its saved values before handling the full export.

Make the handover self-explanatory

In the delivery note, record the encoding, container format, record count and whether the last line ends with a terminator. Include the tool or script version that performed any conversion. Keep both source and output until the receiving application confirms the expected records.

A conversion that passes a syntax check can still lose meaning. If event order matters, compare the first and last event IDs and at least one record in the middle. If long numeric identifiers are present, preserve their documented representation rather than coercing them to a convenient number type.

Q: Can I just add brackets around a JSON Lines file?

Not by itself. Adjacent values also need separators to form array elements, and the original lines must first be valid records. Use a parser and writer for the chosen format, then compare counts and representative values.

Q: Is a line containing null an empty record?

It is a valid JSON value under the JSON Lines convention, unlike a blank physical line. Your importer may require each value to be an object, so validate that additional contract separately.

KITFORMA

Put it into practice

Reading guides is free and needs no account. Linked tools explain any account or Pro requirements.

Further reading

Sources last reviewed:

KitForma prepared this guide with AI assistance. Examples illustrate a workflow; they are not measurements of real sales, search volume or success. Check the linked sources and the result with your own file.

How to use this guide

Published and maintained by KitForma. The linked references explain the relevant formats and definitions. Examples use sample inputs; they do not establish a speed, quality or compatibility guarantee for your files. Check the tool’s stated limits and inspect your downloaded result.

Publisher and project details

Get new guides in your inbox

Join our optional email newsletter for KitForma tools, practical guides and product updates.

Give consent on the separate Brevo form, then confirm the link in your email. This is separate from account and support preferences. Unsubscribe using the link in every newsletter.

Open comments in an ad-free view

KitForma

What would you like to do?

Support center