JSON input (array or object)

How to split a JSON file

Open your JSON file with the Open file button, or paste its contents into the input box. Set how many items you want in each part, and press Split. Each part appears below with its own Copy and Download buttons, so you can save the pieces as separate .json files.

How the split works

If the input is an array, it is cut into groups of the size you choose, in the original order. If the input is an object, its top-level keys are divided into groups, and each part is a smaller object holding those keys. The last part may hold fewer items than the others.

Example: splitting an array

Input:

[1,2,3,4,5]

With 2 items per part, you get three parts:

[1,2]   [3,4]   [5]

Splitting JSON for LLMs and AI tools

Large JSON files often do not fit into the context window of an AI model, and very long pasted data can make answers less reliable. A common fix is to split the data into smaller parts and work through them one at a time.

Choose a number of items per part that keeps each part small enough for your model, split, and then paste or send the parts one by one. Every part is valid JSON on its own, so the model can read it without extra cleanup. As a very rough rule, one token is about four characters of English text, but JSON with many short keys and numbers often uses more tokens, so start with a smaller part size and check.

This tool splits by the number of items or keys, not by token count. The splitting itself happens in your browser, but anything you then paste into an AI service is sent to that service, so remove private fields first.

What to do with the parts

Every part is valid JSON on its own. You can format and validate a part, convert it to CSV, or merge the parts back together later.

Frequently asked questions

Is my JSON uploaded to a server?

No. The split runs entirely in your browser with JavaScript. Nothing you paste leaves your device, so it is safe to use with private data.

Can I split a JSON object, not just an array?

Yes. For an object, the top-level keys are divided into groups and each part is a smaller object with those keys.

Does splitting change my data?

No. Items keep their original order and values. Each part is formatted with two-space indentation, which only changes whitespace.

How big a file can I split?

It depends on your browser and device, since everything is processed locally. Files of a few megabytes work fine. Very large files may be slow to paste into the box.

Can I download all the parts at once?

Each part has its own Download button. Browsers restrict many simultaneous downloads, so the parts are saved one at a time.

How do I put the parts back together?

Use the Merge JSON tool. For arrays, merging two parts joins them end to end again.

Can I split JSON to fit an LLM context window?

Yes. Pick a smaller number of items per part, split, and use the parts one at a time. Each part is valid JSON by itself.

Does the splitter count tokens?

No. It splits by the number of items or keys. Token counts depend on the model, so check the size of a part and adjust the part size if needed.

Is my data sent anywhere when I split it?

No, splitting runs in your browser. If you then paste a part into an AI service, that part is sent to the service, so remove private fields first.

Related tools

Format and validate JSON before splitting, to catch syntax errors. Use Merge JSON to combine files again. Convert a part with JSON to CSV or JSON to YAML.

Ad placement — in-content (below tool, above footer)