DataSwap Fast file & data format converters, no signup

JPG to PDF

Choose one or more JPG or PNG images, reorder them if needed, then create your PDF. Nothing you upload ever leaves your browser.

How this works without a server

Each image you choose is read locally as raw bytes, then handed to pdf-lib, a JavaScript library that builds real PDF files in memory. For every image, in the order you set, this tool checks whether it's a JPEG or a PNG and calls the matching embed function — embedJpg or embedPng — since pdf-lib doesn't auto-detect the format from the bytes. The embedded image reports its own pixel width and height, and a new page is created at exactly that size before the image is drawn onto it edge-to-edge. Once every image has a page, the finished document is packaged into a downloadable file with Blob and a browser download link. At no point does a file cross the network.

Worked example

Say you choose cover.png (1200 × 1600 px) and photo.jpg (2400 × 1600 px), in that order. Create the PDF and you get a 2-page document: page 1 is exactly 1200 × 1600 points (16.7 × 22.2 inches at the standard 72 points-per-inch PDF scale), page 2 is exactly 2400 × 1600 points (33.3 × 22.2 inches) — each page's proportions matching its source image exactly, with neither photo stretched, cropped, or padded to fit the other. Click ↑ on photo.jpg first and the PDF's page order flips to match.

Frequently asked questions

Are my images uploaded anywhere?

No. Every image you choose is read locally with the browser's File API, and a library called pdf-lib runs entirely in your browser tab to embed each one into a new PDF document. Nothing is sent to a server, so private photos or scans never leave your device.

Why is every page in the PDF a different size?

Each page is sized to exactly match the pixel dimensions of the image on it — a 1200 × 1600 px photo becomes a 1200 × 1600 point page. That keeps every image at its true resolution with no stretching or letterboxing, but it does mean a high-resolution photo can produce a physically large page and a small image a small one. Any PDF viewer will still scale pages to fit your screen automatically.

Can I reorder the images or remove one before creating the PDF?

Yes — after you choose your images, use the ↑ and ↓ buttons next to each one to move it up or down the list, or ✕ to remove it, before creating the PDF. The final document follows the list order top to bottom, one image per page.

Can I mix JPG and PNG files in the same PDF?

Yes. pdf-lib doesn't guess the format from the file's bytes, so this tool checks each file's type and calls the matching embed function — embedJpg for JPEGs, embedPng for PNGs — automatically, file by file. Neither path re-compresses your image: a JPEG keeps its original compressed data and a PNG stays lossless.