# Images to PDF

URL: https://hifreetools.com/pdf/images-to-pdf

> Add JPG, PNG, or WebP images, arrange them in the order you want, and download a single PDF with one image per page. Everything runs in your browser, so your images are never uploaded.

## Quick answer

To turn images into a PDF, add your JPG, PNG, or WebP files, put them in order with the ← → buttons, choose a page size (A4, US Letter, or match each image), and download. The tool places one image per page, fitting each within the page with a small margin, and runs entirely in your browser using pdf-lib — so your images are never uploaded and there is no watermark.

## Formula

- Fit-to-page scaling: scale = min((pageW − 2·margin) / imgW, (pageH − 2·margin) / imgH)

Each image you add is shown as a thumbnail you can reorder or remove. When you build the PDF, every image is first drawn onto an HTML canvas over a white background (so transparent PNGs don't turn black) and read out as JPEG data — this lets any format (JPG, PNG, WebP, GIF) be embedded reliably. For the A4 or US Letter page sizes, the image is scaled to fit inside the page with a 24-point margin and centred; choosing "match each image" makes every page exactly the size of its image. The pages are added in your chosen order and the finished PDF is downloaded. All of this happens on your device.

## Examples

- Three photos into one A4 PDF: photo1.jpg + photo2.jpg + photo3.jpg, page size A4 → A 3-page PDF, one photo per A4 page, centred with a margin
- Match the image size: A 1200×800 screenshot, page size "Match each image" → A 1-page PDF whose page is exactly 1200×800 points
- Reorder before exporting: cover.png moved to the front, then page1.jpg, page2.jpg → A PDF with the cover as page 1

## FAQ

**Are my images uploaded to a server?**
No. Everything happens in your browser — images are drawn on a local canvas and embedded into the PDF with pdf-lib, then the file is downloaded. Your images never leave your device.

**Which image formats are supported?**
JPG, PNG, WebP, and GIF all work. Each image is normalised to JPEG on a white background before embedding, so any common format can be added.

**Can I choose the page size?**
Yes. Pick A4 or US Letter to fit each image onto a standard page with a margin, or choose "Match each image" to make every page exactly the size of its image.

**How do I set the order of the pages?**
Each image appears as a numbered thumbnail. Use the ← and → buttons to move an image earlier or later; the PDF pages follow that order. Use ✕ to remove an image.

**Is there a watermark or limit?**
No watermark and no fixed limit, though very many large images use your device's memory. The output is a clean PDF with one image per page.

**Will transparent areas look right?**
Transparent parts of a PNG become white, because each page is drawn on a white background. If you need true transparency, a PDF page is not the right format for it.


## Sources

- [pdf-lib — embed images in PDFs](https://pdf-lib.js.org/)
- [MDN — HTMLCanvasElement.toBlob()](https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob)

Runs in the browser; nothing is uploaded. Cite as: HIFreeTools, "Images to PDF", https://hifreetools.com/pdf/images-to-pdf
