Celljson

Worked examples

See what changes—and what stays text

Identifiers are not numbers

Paste the fixed example below in header mode. It has three input records and two output records. The identifier 001 stays three characters; true and null are text values rather than JSON boolean or null values.

code,active,value
001,true,null
010,false,12.50
[
  {
    "code": "001",
    "active": "true",
    "value": "null"
  },
  {
    "code": "010",
    "active": "false",
    "value": "12.50"
  }
]

A comma and a quote inside one cell

name,note
"red, blue","say ""hello"""

The decoded name is red, blue. The note is say "hello". Doubling the quote inside the quoted field escapes it. A space after the closing quote is rejected instead of being silently discarded.

Arrays keep the first record

For x,y followed by 1,2, array mode emits [["x","y"],["1","2"]] with pretty whitespace. Header mode emits one object, {"x":"1","y":"2"}. Neither mode turns the numeric-looking cells into numbers.

Header-only and empty final fields

Header-mode input code,note has no data records and emits []. Array-mode records a,b, and 1,2, each have three cells; the third is an empty string. An empty object header rejects, so use arrays for this particular table.

Literal keys and explicit ordering

Headers __proto__,constructor,toString followed by x,y,z remain three literal own properties. No prototype is modified. Headers 10,2,0 map by input position to A, B and C. The notes retain that header order; object serialization may list integer-like keys in another order. Arrays preserve column sequence directly.

Unicode and one initial BOM

An optional initial BOM before code is recognized and removed, and the result says so. Text such as café, a bee symbol or an e followed by a combining accent is retained as received. Distinct Unicode sequences are not normalized into one header; only exactly equal header strings count as duplicates.

Multiline received-string fixture

In a direct parser call, key,note\r\nA,"one\r\ntwo" yields one data record whose note contains CRLF between one and two. In the textarea, the browser may normalize line endings first. Compare the conversion to the actual textarea value, not original clipboard/file bytes. The visible result preserves the string the parser receives.

An error is preferable to overwritten data

Headers a,a reject in object mode because one property would lose a cell. A two-column first record followed by one cell rejects as ragged. A JSON expansion above the output limit also rejects; the previous output and exports are cleared, so a corrected input needs a new explicit conversion.