If you have a multi-page PDF and want to turn each page into a separate PDF file, you can do this easily with PyMuPDF in Google Colab.
1. Install PyMuPDF
First, install the PyMuPDF library:

2. Import Libraries
Then import the libraries you’ll need:

3. Upload Your PDF
The following code opens a file picker so you can upload your PDF:

The uploaded file is stored in the variable input_pdf.
4. Create an Output Folder
Next, create an output folder called split_pages where the individual PDF pages will be saved:

We set exist_ok=True so that Python won't return an error if the folder already exists.
5. Open the PDF
Next, open the uploaded PDF with PyMuPDF:

The variable doc now represents the entire PDF document.
6. Split the PDF into Individual Pages
The following loop goes through every page in the PDF. For each page, it creates a new PDF, copies the current page into it, saves it, and then closes the new PDF:

Here's what happens:
- range(len(doc)) generates the page indexes for every page in the PDF.
- i is the page index, starting at 0.
- A new empty PDF is created for each page.
- insert_pdf() copies the current page into the new PDF.
- save() creates a file such as page_1.pdf, page_2.pdf, and so on.
- close() closes the newly created PDF after it has been saved.
For example, a 5-page PDF will produce:
split_pages/
├── page_1.pdf
├── page_2.pdf
├── page_3.pdf
├── page_4.pdf
└── page_5.pdf
7. Close the Original PDF
Once all the pages have been processed, close the original PDF:

8. Create a ZIP File
Instead of downloading every PDF individually, you can put all the individual PDFs into a ZIP file:

This creates:
split_pages.zip
and automatically starts the download in Google Colab.
Complete Example

Why Split a PDF into Separate PDFs?
Splitting a PDF into individual pages is useful when you need to:
- Extract specific pages from a larger document.
- Process pages separately.
- Upload individual pages as separate documents.
- Share only certain pages with someone.
- Organize a large PDF into smaller files.
Open the notebook
Open the Google Colab notebook for this PDF mini-guide and run the code as you follow along.
Ready to put this into practice? Check out the Python and PDF resources in our store.
More PDF Python Resources
Want to learn how to count the number of pages in a PDF?
Check out this mini-guide: How to Count the Number of Pages in a PDF Using PyMuPDF.
Comments ()