> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/stackai-tools/document-processing/split-files.md).

# Split Files

Divide parsed file content into smaller text groups. Use this tool before a loop or another step that processes documents in manageable parts.

## Use this tool

1. Supply the parsed **File content**.
2. Choose **Split style**: character chunks, pages, files, or a fixed number of parts.
3. Set the corresponding size or count.
4. Run the tool and inspect **Chunks** before processing each item.

## Behavior and limits

This tool returns text groups, not separate downloadable PDFs. Page and file boundaries depend on the supplied parsed content. When dividing into a fixed number of parts, more parts than pages can produce empty trailing items. Use [Page Split](https://docs.stackai.com/stackai-tools/document-processing/page-split.md) to create separate files by page.

## Inputs

| Field                   | Parameter    | Description                                           |
| ----------------------- | ------------ | ----------------------------------------------------- |
| File content (required) | `input_text` | The text content from one or more files to be chunked |

## Configuration

| Field                  | Parameter              | Description                                                                                                                                                                                                                      |
| ---------------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Split style (required) | `split_style`          | Choose how to split the content: by chunks (character limit), by pages, by files, or into a fixed number of parts                                                                                                                |
| Characters per chunk   | `characters_per_chunk` | Maximum number of characters per chunk (default: 500,000). Each resulting chunk can't be smaller than chunk size of files node.                                                                                                  |
| Pages per chunk        | `pages_per_chunk`      | Number of pages to include in each chunk (default: 1, minimum: 1).                                                                                                                                                               |
| Files per chunk        | `files_per_chunk`      | Number of files to include in each chunk (default: 1, minimum: 1).                                                                                                                                                               |
| Number of parts        | `number_of_parts`      | Number of parts to divide all pages into (default: 2, minimum: 1). Pages are flattened across all files in order, then split into this many contiguous, roughly-equal parts. Fewer pages than parts yields trailing empty parts. |

## Outputs

| Field  | Parameter | Description                  |
| ------ | --------- | ---------------------------- |
| Chunks | `chunks`  | List of chunked text content |

## Related guides

* [Parsing, OCR, and Document Structure](https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/parsing-ocr-and-document-structure.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/stackai-tools/document-processing/split-files.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
