DocSplitter is a command-line tool for splitting structured DOCX and PDF documents into smaller files using their headings. It can inspect a document's heading hierarchy, preview the output plan, and create the planned files without modifying the input document.
DocSplitter is available as an npm package and as a Windows x64 command-line application.
The npm package requires Node.js 24 and installs the doc-splitter command.
Install DocSplitter globally:
npm install --global @polishedapps/doc-splitterYou can also run it without a global installation:
npx @polishedapps/doc-splitter --helpThe Windows x64 CLI application does not require Node.js or npm.
- Open the latest GitHub Release.
- Download the
DocSplitter-CLI-*-windows-x64.zipfile and its matching.sha256file. - Verify the ZIP from PowerShell:
Get-FileHash -Algorithm SHA256 .\DocSplitter-CLI-*-windows-x64.zip
Get-Content .\DocSplitter-CLI-*-windows-x64.zip.sha256The two SHA-256 values must match. Extract the ZIP, open PowerShell in the extracted directory, and run:
.\DocSplitter.CLI.exe --helpDocSplitter.CLI.exe is currently unsigned. The SHA-256 checksum detects changed bytes but does not establish publisher identity.
If Microsoft Defender SmartScreen displays Windows protected your PC, select More info and then Run anyway only after downloading the application from the official GitHub Release and verifying its SHA-256 checksum.
If Smart App Control blocks the executable, Windows does not provide a per-app exception. Use the npm package instead. We do not recommend disabling Smart App Control solely to run DocSplitter.
The examples below use the npm-installed doc-splitter command. When using the Windows application, replace doc-splitter with .\DocSplitter.CLI.exe.
Inspect the heading hierarchy:
doc-splitter inspect "manual.docx"Preview the files that would be created:
doc-splitter plan "manual.docx" --level 2Split a document:
doc-splitter "manual.docx" --output "./output"Splitting is the default workflow, so there is no split command word. Before writing files, DocSplitter displays the planned filenames and asks for confirmation. Pass --yes to confirm without prompting.
| Command | Description |
|---|---|
doc-splitter inspect <input> |
Display the heading hierarchy of a DOCX or PDF document. |
doc-splitter plan <input> |
Calculate output paths and document ranges without creating files. |
doc-splitter <input> |
Preview and create the split output files. |
| Option | Description |
|---|---|
--level <number> |
Split at the selected heading level. |
--parent-headings <none|filename|folders> |
Include parent headings in filenames or folders. |
--index / --no-index |
Include or omit indexes in output filenames. |
--multilevel-index |
Use hierarchical filename indexes. |
--original-name |
Prefix output filenames with the input filename. |
--title-case / --no-title-case |
Transform or preserve heading-name casing. |
--json |
Write one versioned JSON result. |
--quiet |
Suppress progress and nonessential human-readable output. |
The split workflow also supports:
| Option | Description |
|---|---|
--output <directory> |
Select the output directory. The current directory is used by default. |
--subfolder |
Create a unique source-named subfolder under the output directory. |
--yes |
Create the planned files without prompting for confirmation. |
JSON split execution requires --yes:
doc-splitter "manual.pdf" --output "./output" --subfolder --json --yesRun the built-in help for the complete command reference:
doc-splitter --help
doc-splitter inspect --help
doc-splitter plan --help