
How to Split JSON Files: Fastest and Easiest Way (2026)
Split large JSON files into smaller chunks with an online tool, Python scripts, or jq. Includes examples for big datasets and nested JSON.
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.
Split arrays or objects by item count, number of chunks, or maximum file size. Processing happens locally.
See one JSON array become valid, manageable chunks
[
{ "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" }
]// 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" }
]See how files are chunked
Split by File Size
Split by Array Count
Python and jq scripts
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")# 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.jsonWhen to split JSON files
Break oversized JSON payloads into chunks that fit within an API's request size limit so each request succeeds without truncation.
Split a massive JSON export into smaller batches for sequential database imports, avoiding transaction timeouts and memory pressure on your DB server.
Divide a large dataset into N chunks and process them concurrently across workers, threads, or serverless functions for dramatically faster throughput.
Turn a large JSON dump into smaller files that are easier to open in VS Code, Sublime, or another editor without freezing.
Common questions
In-depth walkthrough
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.
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).
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.
Once the file is split, use a JSON editor to validate each chunk, inspect nested records, or convert the output into another workflow.
Hand-picked guides to go deeper

Split large JSON files into smaller chunks with an online tool, Python scripts, or jq. Includes examples for big datasets and nested JSON.

Merge multiple JSON files into one using free online tool, Python, or jq command line. Complete guide with code examples for arrays, objects, nested JSON, and deduplication.

Format JSON in Notepad++ with the JSTool plugin. Includes setup, shortcuts, validation, minification, troubleshooting, and formatting tips.