Skip to content

Browser tool

Convert row objects to and from JSON Lines

Move between an array and one record per line. Follow two stage cues through both directions and check which station receives each cue.

Convert JSON arrays and JSON Lines

Convert a flat table of string-valued objects in this tab. The output includes the original field names and cell values.

Each object must use the same set of nonblank field names. Each value must be a string. Use double quotes around values such as "0007" and "12.30".

Use one object per physical line. LF and CRLF may be mixed. One final line ending is optional. For zero records, leave the input completely empty. The browser may display pasted CRLF as LF.

JSON Lines output uses a compact object and a final LF for each record. Array output is compact. Row order, field names and string values are preserved. Spacing, escape spelling and the order of fields may change.

Each input and download can contain up to 100,000 UTF-16 code units. The table can have up to 2,000 records and 1 to 64 fields per record.

0 / 100,000

Enable JavaScript to use this tool in this tab.

Start with two named records

Open stations.array.json from the field-order exercise. Choose the array-to-lines direction and paste the entire array, including its brackets. Both objects contain station and cue, although the second writes cue first.

Convert the array. The first output line associates C07 with pit and the second associates C08 with fly. There is one compact object on each physical line, with an LF after the last object.

Reverse the conversion

Save the complete two-line result before you change direction. Select lines to array, then paste the saved text. The result is one compact JSON array. Read the station field on the second record to check the association.

Across the two forms, compare records in sequence and compare fields by name. Indentation, escape spelling and the sequence in which an object displays its members can change when text is written again.

Check a file boundary

The reader accepts LF or CRLF between records and accepts a final record without a trailing newline. Two separators after the last record leave an empty line, which stops this converter. It also rejects a byte order mark and a carriage return on its own.

An empty array produces exactly zero characters of line text. In the other direction, an entirely empty input produces an empty array. A space or a line break by itself is a blank line and receives a refusal.

Prepare a bounded handoff

Every record needs the same 1 to 64 nonblank field names with string values. A number, null or nested object needs a separately agreed representation. A table matrix can be inspected in the JSON table checker.

Conversion runs in the browser. The limits are 2,000 records and 100,000 UTF-16 code units for each of the input and output. If the result exceeds the text limit, the conversion stops. A successful output contains the field names and values you supplied.

Reference sources

Continue with a check