SmartQueryTools

Split Column in JSON Files Online

Split a column into multiple columns by delimiter in JSON files directly in your browser. Turn "First Last" into separate first and last name columns — no upload required.

How to split Column in JSON files

  1. Drop your file onto the upload area. The first column is selected as the column to split, and the first 200 rows are shown.
  2. Pick the column to split and type the delimiter. The default is a single space. Any text works, including multi-character delimiters such as " | ".
  3. Set the number of parts, from 2 to 10. Each part gets a name box, pre-filled as column_1, column_2 and so on, which you can rename.
  4. Tick Remove original column if you only want the parts, then click Split Column.
  5. Check the preview and download the file. The new columns sit directly after the source column, or in its place if you removed it.

Your file is processed locally in your browser and is never uploaded. The free limit is 50 MB per file; larger files work if your device has the memory for them.

Worked example

A warehouse stock sheet packs category, colour and size into one SKU code. The buying team wants to filter by colour and size separately.

Input (JSON)

[
  {
    "sku": "SHOE-RED-42",
    "stock": 14,
    "warehouse": "WLG"
  },
  {
    "sku": "SHOE-BLK-39",
    "stock": 3,
    "warehouse": "AKL"
  },
  {
    "sku": "HAT-BLUE",
    "stock": 22,
    "warehouse": "WLG"
  },
  {
    "sku": "SOCK-WHT-M-3PK",
    "stock": 40,
    "warehouse": "CHC"
  }
]

Settings

  • Column to split: sku
  • Delimiter: -
  • Number of parts: 3, named category, color, size
  • Remove original column: ticked

Result

categorycolorsizestockwarehouse
SHOERED4214WLG
SHOEBLK393AKL
HATBLUE22WLG
SOCKWHTM40CHC

Each part is taken by position. HAT-BLUE has only two parts, so its size is an empty string. SOCK-WHT-M-3PK has four, and anything after the third part is dropped, so 3PK is lost. Raise the number of parts to keep it. The size column is text even where it holds numbers like 42.

Working with JSON files

Only top-level keys are offered as the column to split. A key holding strings like "tags": "red|sale|new" splits cleanly on "|" into separate keys. If the value is already a JSON array, it is cast to its text form, for example [red, sale, new], before splitting, so the pieces include brackets. Arrays are better handled by flattening or unpivoting instead.

Each part becomes a new key in every object, in the position after the source key. Objects where the source key was missing or null get null for every part. Objects whose value had too few parts get "" for the extra keys, so a consumer that checks for missing keys will find them present. The part values are always JSON strings, so "42" is written in quotes even when it looks like a number. Key order in each output object follows the column order shown in the preview.

Frequently Asked Questions

Can I split a JSON array field into columns?

Not cleanly. Arrays are converted to text before splitting, so the first and last pieces keep the brackets. Flatten the JSON or use Unpivot for array data.

Are split JSON values written as numbers or strings?

Strings. A part like 42 is written as "42". Run Cast Columns on the result if you need real JSON numbers.

What happens when a value has more parts than I asked for?

The extra parts are dropped. Splitting "Mary Ann Lee" into 2 parts on a space gives "Mary" and "Ann", and "Lee" is lost. Set the number of parts to the largest count in your data.

What happens when a value has fewer parts?

The missing parts are empty strings, not NULL. A NULL in the source column gives NULL in every part.

Is the delimiter a regular expression?

No. It is matched as literal text and is case-sensitive. Use Regex Extract if you need a pattern.

Related Tools