Hash to Tabular Data Converter
Convert JSON arrays of mixed objects, arrays, and primitives into clean tabular data. Export as HTML table, CSV, or JSON.
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.
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.
Where cols(entry) is defined per entry type:
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 Type | Column Strategy | Cell Value Rule | Example Input | Example Cell Output |
|---|---|---|---|---|
| Primitive (number) | primitive | Raw value | 42 | 42 |
| Primitive (string) | primitive | Quoted string | "hello" | "hello" |
| Primitive (null) | primitive | null | null | null |
| Primitive (true/false) | primitive | Boolean literal | true | true |
| Array (flat) | index0, index1, β¦ | Element at position i | ["a", 1] | "a" | 1 |
| Object (flat) | Each key as column | Property value | {name: "Jo"} | "Jo" |
| Object with null value | Key column created | null | {x: null} | null |
| Object with nested object | Key column created | object (type tag) | {a: {b:1}} | object |
| Object with nested array | Key column created | array (type tag) | {a: [1,2]} | array |
| Empty object {} | No new columns | All cells empty | {} | (empty row) |
| Empty array [] | No new columns | All cells empty | [] | (empty row) |
| Nested array in top-level array | index0, β¦ | Element value or type tag | [[1, [2]]] | 1 | array |
| Mixed types across rows | Union of all columns | Missing keys β empty | [{a:1},{b:2}] | Row 1: a=1, b=β | Row 2: a=β , b=2 |
| undefined value | Key column created | (empty string) | {a: undefined} | (empty) |
Frequently Asked Questions
{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.JSON.stringify omits undefined values.