How to Batch Convert an Entire Images Folder to PDF
Whether you have a folder of product photos, a collection of scanned pages, a set of design mockups, or an archive of receipts captured by a mobile app, there comes a point where images need to become PDFs. PDFs are more manageable than image folders: they are a single file, they are universally viewable, they can be emailed cleanly, and they are easier to archive and retrieve. Batch converting images to PDF means processing an entire folder in one operation rather than converting images one by one. For a folder of 200 product images that each need to become a one-page PDF, or for 30 folders of scanned receipts that each need to become a combined PDF per folder, the time savings are enormous. This guide covers the full spectrum of batch image-to-PDF conversion: single-image-to-single-PDF (one output per input image), multiple-images-to-single-PDF (all images combined into one document), and hybrid approaches where groups of images are combined into separate PDFs. You will learn which tools handle each scenario, how to control page sizing and image placement, how to handle mixed image formats in the same folder, and how to script the whole operation for recurring use.
Choosing Your Conversion Mode: One-to-One or Combined
Before selecting a tool or writing a script, decide which conversion mode you need. This choice determines your entire approach. One-to-one conversion creates one PDF for each input image. This is appropriate when each image represents a standalone document — a scanned invoice, a product photo that needs its own PDF data sheet, or an individual design asset. The output is a folder of single-page PDFs matching the input image count. Combined conversion merges all images in the folder (or a group of images) into a single multi-page PDF. This is appropriate when the images represent pages of a single document — pages scanned individually that need to be reassembled, a sequence of presentation slides, or a photo book. The output is one PDF containing all images as sequential pages. Hybrid conversion groups images from subfolders into separate combined PDFs. For example, if your folder structure organizes scanned receipts by month (January, February, March), each month's subfolder of images becomes one combined PDF. This is the most common real-world scenario for batch image-to-PDF work. For one-to-one conversion, most batch tools loop through files and convert individually. For combined conversion, you load all images in order and merge them into a single output. For hybrid conversion, you loop through subfolders and apply combined conversion within each subfolder.
- 1Determine your output mode: one PDF per image, all images into one PDF, or one PDF per subfolder/group.
- 2Sort your images by your intended page order before converting — alphabetical, date-modified, or a custom sequence — since most tools process in file system order.
- 3Confirm all images in the folder are in supported formats: JPG, PNG, WebP, and TIFF are universally supported; other formats may need conversion first.
- 4For combined multi-page PDFs, number your source images sequentially (001.jpg, 002.jpg) to guarantee correct page order in the output.
Tools for Batch Image-to-PDF Conversion
Multiple tools handle batch image-to-PDF conversion, each with different strengths for different conversion modes. LazyPDF's Image to PDF tool is the easiest option for combining multiple images into a single PDF. Upload images in your intended order, configure page settings, and download the resulting PDF. This works well for batches where you are combining a set of images into one document. For scripted one-to-one batch conversion, ImageMagick is the most flexible free tool. The command `convert input.jpg output.pdf` converts a single image to a PDF. In a loop: `for f in *.jpg; do convert "$f" "${f%.jpg}.pdf"; done`. For combined conversion: `convert *.jpg combined.pdf` or with ordering control: `convert $(ls -v *.jpg) combined.pdf`. Ghostscript combined with ImageMagick handles more complex scenarios, including size and quality control. For higher-quality output from a set of images: `convert -density 150 *.jpg -compress jpeg -quality 85 output.pdf`. Python with Pillow and ReportLab provides maximum control. Pillow opens and manipulates images; ReportLab or fpdf2 creates PDFs. You can control exact image placement on the page, add margins, embed images at specific positions, and apply conditional logic (different page sizes for portrait vs. landscape images). For Windows users with no command-line experience, IrfanView (free) supports batch conversion with a visual interface, including combining multiple images into one PDF and converting folders of images to individual PDFs.
- 1For combining images into one PDF, use LazyPDF's Image to PDF tool — upload all images in order and download the combined PDF.
- 2For one-to-one batch conversion on macOS/Linux: `for f in /folder/*.jpg; do convert "$f" "/output/$(basename $f .jpg).pdf"; done`
- 3For combined conversion of an entire folder: `convert -density 150 $(ls /folder/*.jpg | sort -V) /output/combined.pdf`
- 4For subfolder-based hybrid conversion, write a script that loops over subfolders: `for dir in */; do convert "$dir"*.jpg "${dir%/}.pdf"; done`
Handling Mixed Image Formats and Page Sizing
Real-world image folders are rarely uniform. You may have a mix of JPG, PNG, TIFF, and WebP files. Your images may have different dimensions — some portrait, some landscape, some square. Handling this variety cleanly requires some preparation and the right tool configuration. For mixed formats, most conversion tools handle JPG and PNG without issues. TIFF and WebP may require checking your tool's format support. ImageMagick handles virtually all image formats. If you have an unusual format, convert it to JPG or PNG first using ImageMagick or another image tool before the PDF conversion batch. Mixed image dimensions create a page sizing challenge. If you want a uniform page size (A4, Letter), images will either be scaled (potentially distorted if aspect ratios differ) or centered with whitespace. For document archives where consistent page size matters, choose 'fit to page' scaling: each image is scaled to fill the page while maintaining aspect ratio, with whitespace filling the remaining area. If your images already represent correctly sized document pages (e.g., scanned at A4 dimensions), use the 'image size as page size' mode, which creates each PDF page at exactly the pixel dimensions of the input image. This produces the most accurate result for document scanning workflows. For professional output, set a consistent DPI value for the PDF. The PDF format stores images at a specific resolution; if this is not set, viewers may render the page at an unexpected size. For 300 DPI images that should display at A4 size, calculate the page dimensions in points (1 inch = 72 points): A4 at 300 DPI is 2480x3508 pixels, which maps to 595x842 points.
Maintaining Quality and Managing Output File Sizes
The quality of images in the resulting PDF depends on how they are embedded. Most tools embed images using JPEG compression, which introduces some quality loss. For document archives where text legibility is critical, use PNG for source images and lossless embedding in the PDF. For JPG source images, the key is to avoid recompressing them unnecessarily. Some conversion tools decompress the JPG and recompress it at a different quality level during PDF creation, which degrades the image. Tools that embed JPG images directly into the PDF without recompression (using DCT compression natively) produce better results. Both ImageMagick (with the -compress jpeg flag) and PyMuPDF support direct JPG embedding. Output file size is a frequent concern with image-based PDFs. Each page in an image PDF stores a rasterized image, so there is no text compression — the file size is essentially the sum of all embedded images plus PDF overhead. For a folder of 100 high-resolution scans, the resulting PDF can easily reach hundreds of megabytes. Strategies for managing output size: compress source images to a reasonable DPI before converting (150 DPI is readable and compact), use JPEG embedding rather than TIFF or uncompressed, and run Ghostscript compression on the final PDF after creation. The combination of 150 DPI scanning and Ghostscript /ebook compression can reduce sizes by 70-80% compared to unoptimized output.
Frequently Asked Questions
What image formats can I convert to PDF in a batch?
JPG and PNG are supported by every conversion tool. TIFF is widely supported and often preferred for high-quality document scanning archives. WebP, BMP, and GIF are supported by ImageMagick and most modern tools. HEIC (iPhone photos) may require format conversion first — use ImageMagick or a HEIC converter to produce JPG files before including them in a PDF conversion batch. For maximum compatibility across tools, convert all source images to JPG or PNG before running the batch.
How do I combine hundreds of images into one PDF in page order?
The key is controlling the input order. Name your images with zero-padded sequential numbers (001.jpg, 002.jpg) so they sort correctly. Then use ImageMagick: `convert -density 150 $(ls *.jpg | sort -V) output.pdf`. The `sort -V` flag ensures numerical sorting (so 010 comes after 009, not after 001). In Python with PyMuPDF, build your file list with `sorted(glob.glob('*.jpg'))` and process in that order. For LazyPDF's Image to PDF tool, drag files into the interface in the correct order before uploading.
Why is my batch-converted PDF so large?
Image-based PDFs are large because each page contains a rasterized image rather than compressed text. Size is primarily driven by image resolution and JPG quality. To reduce output size: lower the source image DPI to 150 before converting, ensure images use JPEG compression rather than uncompressed TIFF or BMP, and run the final PDF through Ghostscript with the /ebook setting: `gs -dBATCH -dNOPAUSE -dQUIET -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook -sOutputFile=small.pdf large.pdf`. This can reduce file size dramatically without significantly impacting screen readability.
Can I batch convert images to PDF without losing image quality?
For PNG sources (lossless), embed them in the PDF without JPEG conversion by using PNG compression in your tool. For JPG sources, avoid recompression by using tools that embed the original JPEG data stream directly into the PDF. ImageMagick with the `-compress jpeg` flag does this. Quality loss only occurs when tools decompress and recompress images during PDF creation — choose tools that preserve the original compression format when possible.
How do I batch convert images organized in subfolders into separate PDFs?
Write a shell script that loops over subfolders and runs the conversion for each: `for dir in */; do convert "$(ls "$dir"*.jpg | sort -V)" "${dir%/}.pdf"; done`. This processes each subfolder's JPG images into a combined PDF named after the subfolder. For Python, use `os.walk()` to traverse the folder tree and process each directory's files into a separate output PDF. Make sure images within each subfolder are sorted in the correct page order before conversion.