Skip to content

Convert Images to PDF on Windows Free Using WSL

Convert images to PDF free on Windows using WSL. Combine JPGs or PNGs into one PDF with img2pdf (lossless) or ImageMagick — control page order, all offline, no uploads.

MGMCSA Guru Team June 15, 2026 3 min read
A WSL terminal combining JPG images into a single PDF with img2pdf on Windows

You’ve scanned a few pages with your phone, or you’ve got a set of receipts as JPGs, and you need them as one PDF to email or file. The web is full of “JPG to PDF” sites that want you to upload the lot — not ideal when the images are receipts, an ID, or a signed document.

WSL combines images into a PDF locally, for free. The standout tool is img2pdf, which embeds your JPGs without re-encoding them, so the PDF is small and the images stay pixel-perfect. ImageMagick is the fallback when you need more control.

No WSL yet? See the WSL install guide.

Install the tools

sudo apt update && sudo apt install -y img2pdf imagemagick

img2pdf is the recommended tool here; imagemagick is the alternative.

The simple case: one image to PDF

img2pdf photo.jpg -o photo.pdf

That wraps the JPG into a single-page PDF, lossless, in a fraction of a second.

Combine many images into one PDF

List the files in the order you want them as pages:

img2pdf page1.jpg page2.jpg page3.jpg -o document.pdf

To grab every JPG in a folder, use a glob — but mind the ordering (see the next section):

img2pdf *.jpg -o document.pdf

Get the page order right

Pages come out in the order the files are listed. A glob like *.jpg sorts alphabetically, which trips people up: page10.jpg sorts before page2.jpg. Two reliable fixes:

  • Zero-pad the numbers when naming: page01.jpg, page02.jpg, … page10.jpg.
  • List explicitly in the exact order you want on the command line.

To check the order a glob will use before committing:

ls -1 *.jpg

The ImageMagick alternative

ImageMagick also builds PDFs and can mix in resizing or other edits:

magick *.jpg document.pdf

It re-renders the images rather than embedding them, so the file can be larger and slightly lossy. Its bigger catch is the security policy:

Which command to use

img2pdf a.jpg -o a.pdf Single image to PDF, lossless
img2pdf *.jpg -o doc.pdf All JPGs in a folder into one PDF
img2pdf 01.jpg 02.jpg -o doc.pdf Explicit page order
magick *.jpg doc.pdf ImageMagick (re-encodes; may be blocked)

Mixing JPG and PNG

You can combine both in one PDF — just list them in order:

img2pdf scan1.png scan2.jpg scan3.png -o combined.pdf

Each file becomes a page. The format mix doesn’t matter; the order on the command line does.

Wrapping up

Turning images into a PDF on Windows is one command: img2pdf *.jpg -o document.pdf for a lossless, compact result, or magick *.jpg document.pdf if you need ImageMagick’s extra handling (and don’t hit the policy block). The thing to watch is page order — zero-pad your filenames or list them explicitly.

It’s free, it runs in WSL, and your scans and documents never get uploaded anywhere. To go the other way and pull images back out of a PDF, see convert PDF to JPG or PNG.

Frequently asked questions

What's the difference between img2pdf and ImageMagick for this?

img2pdf embeds JPGs into the PDF without re-encoding them, so there's no quality loss and the PDF stays small. ImageMagick re-renders images, which is more flexible but can enlarge the file and reduce quality. For photos and scans, img2pdf is usually the better choice.

How do I control the page order in the PDF?

Pages follow the order you list the files. A plain glob like *.jpg sorts alphabetically, so name files with zero-padded numbers (01, 02, 10) for correct order, or list them explicitly on the command line in the order you want.

Why does ImageMagick refuse to write a PDF?

Many ImageMagick installs ship a security policy that blocks PDF output by default. You can either use img2pdf instead, which has no such restriction, or edit ImageMagick's policy.xml to allow PDF writing. img2pdf is the simpler route.

Do my images get uploaded when converting to PDF this way?

No. img2pdf and ImageMagick run locally in WSL, so your images and the resulting PDF stay on your machine. That matters for scanned documents, IDs, or receipts you wouldn't want on an online converter.

Can I combine both JPG and PNG into one PDF?

Yes. List the files of both types in the order you want, and img2pdf will place each as a page. Mixing formats in a single PDF is fine; just watch the ordering so the pages come out in sequence.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.