> 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/page-split.md).

# Page Split

Create separate file parts from selected page ranges. Use this tool when a later step needs individual files rather than one complete document.

## Use this tool

1. Provide the source **File URLs**.
2. Choose **Split Mode**: Equal Pages or Page Ranges.
3. For Equal Pages, set **Number of Pages per File**. For Page Ranges, enter comma-separated ranges such as `1-3, 4-5`.
4. Run the tool and inspect **Files**. Pass the required file references to the next step.

## Behavior and limits

Page numbers start at 1. Each comma-separated range produces a separate output file; a single number selects one page. Use [Split Files](https://docs.stackai.com/stackai-tools/document-processing/split-files.md) when you only need to divide parsed text.

## Inputs

| Field                    | Parameter            | Description                                                                                                                                                                       |
| ------------------------ | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| File URLs (required)     | `file_urls`          | The URLs of the files to be split, separated by commas, newlines, or semicolons.                                                                                                  |
| Split Mode (required)    | `split_mode`         | Choose how to split: into equal-sized parts of N pages each, or into custom page ranges.                                                                                          |
| Number of Pages per File | `num_pages_per_file` | The number of pages each split file should contain. Only used when Split Mode is 'Equal Pages'. Default is 10.                                                                    |
| Page Ranges              | `page_ranges`        | Comma-separated, 1-indexed page ranges, one per output file (e.g. '1-3, 4-5, 6-13'). A single page like '7' produces a one-page file. Only used when Split Mode is 'Page Ranges'. |

## Outputs

| Field | Parameter | Description                                                            |
| ----- | --------- | ---------------------------------------------------------------------- |
| Files | `files`   | The resulting file references, with their file names and download URLs |

## 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/page-split.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.
