I have a PDF file 6 pages long that I want to split into 1.pdf, 2.pdf, 3.pdf, etc...

Preview does not work for this surprisingly (unless I am missing something).

I would love to be able to do this simple task from the command line, but at this point I will take anything that gets the job done (without downloading sketchy software)

FYI http://users.skynet.be/tools/ does not work as advertised.


Open up the pdf in preview and then on the view menu select thumbnails. Ctrl select the pages that you want now drag and drop them to the desktop.

| improve this answer | |
  • 1
    This worked well. Took me about 30 seconds to do this after flailing about for around 30 minutes. Some people are using this technique in conjunction w/ Automator but I haven't tried it yet. – user391339 Oct 17 '14 at 0:38

This can be achieved by using pdfseparate. You can install poppler with homebrew, by brew install poppler. This will also install pdfseparate. To split the PDF document.pdf into into single pages 1.pdf, 2.pdf, etc. use:

pdfseparate document.pdf %d.pdf
| improve this answer | |
  • 1
    Just installed poppler a day ago for being able to convert PDF documents to SVG with pdf2svg. Didn't notice that poppler comes with pdfseparate command. Since the accepted answer above (dragging and dropping all PDF pages with preview to desktop) requires me to "click around" and since I like solutions on terminal that work automagically by just a single command line, pdfseparate is exactly what I need. Thanks a lot for that hint! – Arvid Dec 18 '15 at 8:47
  • 1
    Interestingly, pdfseparate produces pdfs whose total size is much much larger than the size of the original pdf. I had a 400 pages document with 1.9 MB. After splitting, I got something around 60 MB. – Konstantin Jul 19 '17 at 6:59
  • Just tested Konstantin's comment and he's right. Sizes from pdfseparate were ~9x bigger than those produced from just dragging pages out using preview.app – Vivek Gani Apr 23 at 6:55
  • gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=document-compressed.pdf document.pdf both before and after splitting (i.e., then replace document.pdf by 1.pdf, etc) helps to decrease the size (see also Rastapopoulos's comment). Also it is expected to be bigger if some resources are shared among the pages, such as font inclusions. – ttq Apr 23 at 8:25
  • Not sure if this is due to an update since the earlier comments, but I just split a 13 page PDF of scanned documents (created from an iPhone using Preview's Scan function) and the individual filesizes add up exactly to the original 13 page PDF as you would hope. – Tim MB Jun 27 at 14:42

If you're interested in doing this from the command line, you can look at Benjamin Han's splitPDF python script to do the job. For instance:

splitPDF.py in.pdf 3 5

would split the file in.pdf into 3 files, splitting at pages 3 and 5.

| improve this answer | |
  • This is good, and a bit more flexible in what you can output than pdfseparate above. Though it is mainly for splitting a pdf into chucks of pages, if you did want to split each page, you could easily use seq to produce a range of numbers in your command. Thanks! – dgig Apr 22 '16 at 18:20
  • 1
    something like python splitPDF.py MyPDF.pdf $(seq -s ' ' 1 10 411) worked for me – dgig Apr 22 '16 at 18:29
  • 1
    Words great. I confirm this works directly on MacOS 10.13.3 – MichaelCodes Mar 28 '18 at 21:52

For another alternative, see this answer. This uses the ImageMagick command line tools.

convert x.pdf -quality 100 -density 300x300 x-%04d.pdf

However, you have to be careful with the quality.

| improve this answer | |

If you want to extract a range of pages, you can use the following script which you call like this (assumed that you save it to file pdfextract.py somewhere on your system's PATH, e.g. /usr/local/bin, and assign it execution permission with chmod 744 pdfextract.py):

pdfextract.py --file-in /path/to/large/pdf --file-out /path/to/new/pdf --start --stop

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import argparse
import os
import subprocess as sp

def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('--file-in', required=True, type=str, dest='file_in')
    parser.add_argument('--file-out', required=True, type=str, dest='file_out')
    parser.add_argument('--start', required=True, type=int, dest='start', default=-1)
    parser.add_argument('--stop', required=True, type=int, dest='stop', default=-1)

    args = parser.parse_args()
    assert os.path.isfile(args.file_in)
    assert not os.path.isfile(args.file_out)

    # remove temporary files
    for el in os.listdir('/tmp'):
        if os.path.isfile(os.path.join('/tmp', el)) and el[:12] == 'pdfseparate-':
            os.remove(os.path.join('/tmp', el))

    sp.check_call('pdfseparate -f {:d} -l {:d} {:s} /tmp/pdfseparate-%d.pdf'.format(args.start, args.stop, args.file_in), shell=True)

    cmd_unite = 'pdfunite '
    for i in range(args.start, args.stop + 1):
        cmd_unite += '/tmp/pdfseparate-{:d}.pdf '.format(i)
    cmd_unite += args.file_out
    sp.check_call(cmd_unite, shell=True)

    # remove temporary files
    for el in os.listdir('/tmp'):
        if os.path.isfile(os.path.join('/tmp', el)) and el[:12] == 'pdfseparate-':
            os.remove(os.path.join('/tmp', el))

if __name__ == "__main__":
| improve this answer | |

I have started to put together a tool to provide a simplified interface to common actions.

You can split PDFs into individual pages like this:

$ npm install @lancejpollard/act -g
$ act split my.pdf -o outputDirectory

If nothing else check out the source and see how to write your own script to do this in JavaScript.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.