Skip to the tool
GigaJSON

JSON Splitter

All tools
Format and check
View and query
Convert
JSON to code
Encode and decode
Sample files
Guides Open GigaJSON

Cut a big JSON file into smaller ones, for an upload limit, an import that chokes on size, or a test that needs less data. Open a JSON or JSON Lines file of up to 1 GB. The splitter finds its list of records, then cuts it by records per file, number of files or megabytes per file and gives you the parts in one .zip. Or take a sample: the first records, or records picked at random. The file is read on your computer and never uploaded. To look inside the file first, use the Large JSON Viewer. To join JSON Lines into one array, use JSON Lines to JSON.

How to split a JSON file

  1. Open a JSON or JSON Lines file, or paste one.
  2. Choose how to cut it: records per file, number of files or MB per file. Or switch to Take a sample.
  3. Choose JSON arrays or JSON Lines, then download the .zip of parts or the sample.

Private, and made for big files

This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. JSON and XML input can be up to 1 GB, depending on available memory. Processing runs in a background worker; large analyses can take a minute or more. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.

JSON splitter questions

How do I split a large JSON file?

Open it above, choose records per file, a number of files or a size per file, and press Split. Each part is a valid JSON array (or a JSON Lines file), named data-001.json, data-002.json and so on, all in one .zip.

Which part of the file is split?

Its list of records. If the file is a list, that list. If it is an object, its longest list, such as orders in {"orders": [...], "meta": {...}}. The parts hold only the records; the rest of the object is left out.

Does splitting by size keep each file under the limit?

Yes. Sizes are counted in UTF-8 bytes, the way the file is saved, so no part goes over the size you choose. A single record bigger than the limit gets a file of its own.

How does the random sample work?

It picks the number of records you ask for, each record with the same chance, and keeps them in the order they had in the file. Each run picks a new set.

How large a file can it split?

Up to 1 GB, depending on your computer's memory. JSON Lines files work too. A split makes at most 10,000 files.

Is my data uploaded?

No. The tool runs in your browser, in a background worker. Nothing you paste or open goes to a server, and nothing is kept after you leave the page.

All tools