Split JSON Files Online

Use this JSON splitter online to split a JSON file into multiple valid files by item count, chunk count, or maximum size. Preview every part and download individual files or one ZIP without uploading your data.

JSON files stay in your browser

Practice Splitting with Sample Files

Split a JSON File Into Multiple Files

See one JSON array become valid, manageable chunks

Original File
json
[
  { "id": 1, "name": "Alice", "role": "admin" },
  { "id": 2, "name": "Bob", "role": "editor" },
  { "id": 3, "name": "Charlie", "role": "viewer" },
  { "id": 4, "name": "Diana", "role": "admin" },
  { "id": 5, "name": "Eve", "role": "editor" },
  { "id": 6, "name": "Frank", "role": "viewer" }
]
Split Output
json
// chunk_1.json
[
  { "id": 1, "name": "Alice", "role": "admin" },
  { "id": 2, "name": "Bob", "role": "editor" },
  { "id": 3, "name": "Charlie", "role": "viewer" }
]

// chunk_2.json
[
  { "id": 4, "name": "Diana", "role": "admin" },
  { "id": 5, "name": "Eve", "role": "editor" },
  { "id": 6, "name": "Frank", "role": "viewer" }
]

Visualize the Split

See how files are chunked

Split by File Size

data.json50 MB
chunk_110 MB
chunk_210 MB
chunk_310 MB
chunk_410 MB
chunk_510 MB

Split by Array Count

users.json[10,000 items]
chunk_1[2,000]
chunk_2[2,000]
chunk_3[2,000]
chunk_4[2,000]
chunk_5[2,000]

Programmatic Split

Python and jq scripts

Pythonsplit_json.py
import json, math, sys

with open("large_file.json") as f:
    data = json.load(f)

chunk_size = 2000
chunks = [data[i:i+chunk_size] for i in range(0, len(data), chunk_size)]

for idx, chunk in enumerate(chunks):
    with open(f"chunk_{idx+1}.json", "w") as out:
        json.dump(chunk, out, indent=2)

print(f"Split into {len(chunks)} files")
Bash (jq)split_json.sh
# Split a JSON array into files of 1000 items each.
# Output files (chunk_aa, chunk_ab, ...) are JSON Lines: one item per line.
jq -c '.[]' large_file.json | split -l 1000 - chunk_

# Turn each JSONL chunk back into a regular JSON array
for f in chunk_??; do jq -s '.' "$f" > "$f.json" && rm "$f"; done

# Or slice fixed ranges straight into JSON array files
jq '.[0:500]' large_file.json > chunk_1.json
jq '.[500:1000]' large_file.json > chunk_2.json

Use Cases

When to split JSON files

API Payload Limits

Break oversized JSON payloads into chunks that fit within an API's request size limit so each request succeeds without truncation.

Database Batch Imports

Split a massive JSON export into smaller batches for sequential database imports, avoiding transaction timeouts and memory pressure on your DB server.

Parallel Processing

Divide a large dataset into N chunks and process them concurrently across workers, threads, or serverless functions for dramatically faster throughput.

Editor-Friendly Sizes

Turn a large JSON dump into smaller files that are easier to open in VS Code, Sublime, or another editor without freezing.

FAQ

Common questions

Complete Guide

In-depth walkthrough

Split by count vs split by size - which to use

Use split by count when you need equal chunks for parallel processing or pagination. If you have 10,000 user records and want to process them across 5 workers, splitting into chunks of 2,000 gives you predictable, evenly distributed workloads. Split by count is more predictable for developer workflows where you need to know exactly how many items are in each file.

Use split by size when you're working with upload limits or memory constraints. For example, if you're uploading to an API that has a 50MB file size limit, splitting a 500MB export into 50MB chunks ensures every file will upload successfully. Split by size is better when the constraint is storage or bandwidth, not item count. Sizes are measured on the pretty-printed output, and an item is never cut across two files. The input file itself can be up to 500 MB.

What happens to nested objects when you split

By default the tool splits the root of the file. If your JSON is an array of user objects, each chunk will contain complete user objects with all their nested data intact. Each chunk is a valid, complete JSON file that you can immediately use in another tool or script.

If your JSON is an object like {"users": [...], "meta": {...}}, you have two options. Enter a Target Path such as users (dot notation and indexes like results[0].list work too) to split that nested array or object; the chunks contain only that part, so fields like meta are not copied. Or split the root object itself: the tool asks whether to keep key-value pairs (each chunk is an object with a share of the keys), extract keys only, or extract values only (each chunk is an array).

Using the output files in Python, jq, and Node

In Python, use glob to loop over the split files: for file in glob.glob("chunk_*.json"). In jq, use the --slurp flag to combine them back: jq -s 'add' chunk_*.json. In Node, use fs.readdirSync() to read all chunk files and process them sequentially or in parallel.

Each chunk is a standalone JSON array or object, so you can process them independently without needing to reference other chunks. This makes parallel processing straightforward across multiple threads or serverless functions.

Open the split files in a JSON editor

Once the file is split, use a JSON editor to validate each chunk, inspect nested records, or convert the output into another workflow.

Related Articles