User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Category JSON Tools
Supports JSON, unquoted keys, single quotes, and trailing commas.
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

Flat arrays of heterogeneous entries - mixing primitives, sub-arrays, and objects with varying key sets - resist direct tabular rendering. A naive dump shows nested brackets; the actual structure stays hidden. This converter applies a union-column algorithm: every unique key, every indexed position, and every bare primitive receives its own column. Each top-level element maps to exactly one row. Sub-objects and sub-arrays that cannot be further flattened at depth‑one are tagged with their type (object, array) rather than silently dropped. The result is a dense, printable table equivalent to Chrome's console.table output. Incorrect column alignment in hand-rolled spreadsheets causes silent data mismatches. This tool eliminates that risk by computing the column set deterministically from the input structure.

json to table hash to table json converter tabular data json array data visualization csv export habular

Formulas

The converter maps a top-level JSON array of n entries into a matrix M of dimensions n Γ— c, where c is the total number of unique columns discovered.

C = nβˆͺi=0 cols(entryi)

Where cols(entry) is defined per entry type:

{
{ primitive } if entry is a primitive or null{ index0, index1, …, indexkβˆ’1 } if entry is an array of length k{ key1, key2, … } if entry is an object

Each cell M[i][j] is populated by extracting the value from entry i at column j. If the value is itself a non-null object or array, the cell contains the type tag string ("object" or "array") rather than a recursive expansion. Missing keys produce an empty cell.

Where C = complete ordered column set, n = number of top-level entries, cols = column extraction function, entryi = the i-th element of the input array, k = sub-array length.

Reference Data

Entry TypeColumn StrategyCell Value RuleExample InputExample Cell Output
Primitive (number)primitiveRaw value4242
Primitive (string)primitiveQuoted string"hello""hello"
Primitive (null)primitivenullnullnull
Primitive (true/false)primitiveBoolean literaltruetrue
Array (flat)index0, index1, …Element at position i["a", 1]"a" | 1
Object (flat)Each key as columnProperty value{name: "Jo"}"Jo"
Object with null valueKey column creatednull{x: null}null
Object with nested objectKey column createdobject (type tag){a: {b:1}}object
Object with nested arrayKey column createdarray (type tag){a: [1,2]}array
Empty object {}No new columnsAll cells empty{}(empty row)
Empty array []No new columnsAll cells empty[](empty row)
Nested array in top-level arrayindex0, …Element value or type tag[[1, [2]]]1 | array
Mixed types across rowsUnion of all columnsMissing keys β†’ empty[{a:1},{b:2}]Row 1: a=1, b=βˆ… | Row 2: a=βˆ…, b=2
undefined valueKey column created(empty string){a: undefined}(empty)

Frequently Asked Questions

The converter flattens to depth one only. If a property value is itself an object, the cell displays the type tag object. If it is an array, the cell displays array. This prevents combinatorial column explosion on deeply nested structures. For recursive flattening, pre-process your data with a dedicated JSON flattener before pasting.
Index columns are named index0, index1, etc. If an object entry contains a key literally named "index0", both the array-derived and object-derived values share the same column. The object value takes precedence for that row. To avoid ambiguity, rename conflicting keys in your source data before conversion.
Yes. The parser pre-processes the input to normalize JS-style syntax into valid JSON. Unquoted keys like {name: "Alice"} and single-quoted strings like {'name': 'Alice'} are supported. Trailing commas are also stripped. However, JS expressions such as Date.now() or template literals are not evaluated and will cause a parse error.
The algorithm is O(n Γ— c) where n is the number of entries and c is the column count. For arrays under 10000 entries with fewer than 50 columns, conversion completes in under 200ms on modern hardware. Beyond that, the UI may briefly show a processing indicator while the table is built in chunks.
All string cell values are wrapped in double quotes in the CSV output. Any internal double-quote characters are escaped by doubling them (RFC 4180 compliance). Embedded newlines and commas within values are preserved correctly inside the quoted field.
When a column exists because another row's object defined that key, rows that lack the key produce an empty cell. This is intentional: empty means "key not present in this entry". The value null is explicitly displayed as null, and undefined (only possible in JS literal mode) is shown as empty since JSON.stringify omits undefined values.