Convert

Compress JPG to PDF: Shrink the Photos First, Then Combine

A PDF made from phone photos is almost exactly as big as the photos inside it. We measured both routes on the live tools so you can hit an upload limit on the first try.

Updated ยท 10 min read

Screenshot of the Photo to PDF tool tool on Dokurapi
Screenshot of the related Dokurapi tool. All processing runs in the browser.

To compress JPG to PDF, shrink every photo first with the Compress Photo tool, then combine the smaller JPGs with Photo to PDF. The order matters because Dokurapi places each JPG into the PDF exactly as it is. In our test on 14 October 2026, three original photos totalling 7,551,447 bytes produced a 7,553,147-byte PDF. The same three photos compressed to the 200 KB preset first produced a PDF of 430,074 bytes, small enough for a 500 KB upload limit. Everything happens inside your browser tab.

This guide explains why the first route fails, how to work out a size budget for each photo before you start, and what to check before you upload. All numbers come from the live tools and from the code in assets/app.js, not from estimates.

Why a PDF of photos is as big as the photos

Many people expect "convert to PDF" to make files smaller. It usually does not. A PDF is a container. When you put a JPG inside it, the PDF stores the image data plus a little page information. Dokurapi's Photo to PDF tool uses the open source pdf-lib library and calls its JPG embedding function, which copies the JPG bytes into the PDF without re-encoding them. That keeps the photo sharp, but it also keeps every byte.

Our measurement shows how small the extra cost is. The three test photos were 3,471,789, 3,089,217 and 990,441 bytes, a total of 7,551,447 bytes. The PDF came out at 7,553,147 bytes, only 1,700 bytes more than the photos. That overhead covers three A4 pages and the PDF structure. In practice, the size of your PDF is the size of your photos.

PNG files behave the same way, only worse. Photo to PDF embeds a PNG as PNG, which is lossless and often several times larger than a JPG of the same picture. Other image types, such as WebP, are drawn onto a canvas, limited to 1,800 pixels on the longest side and saved as JPG at 90% quality before they go into the PDF. So the only reliable way to control the PDF size is to control the photos before you combine them.

Ready to try it? The tool is free and runs in your browser.

Open the Photo to PDF tool

How to compress JPG to PDF, step by step

The route that works is short. You compress first, combine second and check last.

  1. Count your photos and read the limit. Note how many pages the form expects and the maximum file size, for example three pages in one PDF of 500 KB.
  2. Work out the budget per photo with the table in the next section.
  3. Compress each photo in the Compress Photo tool. Choose the preset or type the custom target from the table, one photo at a time, and download each result.
  4. Open Photo to PDF and add the compressed JPGs, not the originals. Up to 10 photos fit in one PDF.
  5. Put the pages in order with the arrow buttons, then press Create PDF.
  6. Check the result in Check PDF Size before you upload.
Two routes from photos to PDF: route A puts three original JPGs totalling 7.55 MB straight into Photo to PDF and gets a 7.55 MB PDF, route B compresses each photo with the 200 KB preset to 137, 155 and 137 KB first and gets a 430 KB PDF
The two routes we measured. Only route B fits a 500 KB limit, because the PDF keeps each JPG exactly as it receives it. Diagram of measured data.

If you want to understand what the Photo to PDF tool itself does with page size and order, the photo to PDF guide covers it in detail. This article stays on the size problem.

Work out a size budget for each photo

The budget is simple arithmetic. Dokurapi always aims 6% under the number you choose, so a 500 KB limit becomes a safe target of 470,000 bytes. NIST explains why: "KB" can mean 1,000 or 1,024 bytes depending on who counts, and the margin covers both. From the safe target, subtract about 2,000 bytes for the PDF structure, then divide by the number of photos.

When you type a custom target into the Compress Photo tool, the same 6% margin is applied to that number too. The table below already accounts for that, so you can type the value in the last columns directly.

PDF limitSafe target1 photo2 photos3 photos5 photos
500 KB470,000 bytes500 KB presetcustom 248 KBcustom 165 KBcustom 99 KB
1 MB940,000 bytes1 MB presetcustom 498 KBcustom 332 KBcustom 199 KB
2 MB1,880,000 bytes2 MB presetcustom 998 KBcustom 665 KBcustom 399 KB

Each custom value is the per-photo budget divided by 940, rounded down. For three photos in a 500 KB PDF the budget is (470,000 minus 2,000) divided by 3, which is 156,000 bytes, and 156,000 divided by 940 gives 165 KB. With a single photo the PDF overhead is small enough that the preset with the same number as the limit already fits.

You do not have to be exact. In our test we used the plain 200 KB preset for all three photos. The tool aims for 188,000 bytes per photo, which is above the 156,000-byte budget, but the results landed lower anyway, and the PDF still fit.

What the compression did to each photo

The Compress Photo tool starts at 84% JPG quality and limits the longest side to 2,400 pixels. If the file is still too big, it lowers the quality in steps of 10 points. Our first photo, a 4,000 by 3,000 pixel test image of 3.47 MB, was resized to 2,400 by 1,800 and saved at 54% quality, which gave 136,931 bytes. The second photo stopped one step earlier, at 64% and 154,892 bytes. The portrait-shaped third photo needed less work and stopped at 74% quality and 136,571 bytes.

Dokurapi Compress Photo tool with foto-1.jpg of 3.47 MB, target 200 KB, status Safe target reached, result panel showing original 3.47 MB, output 137 KB, quality and dimensions 54% and 2400 by 1800 px
Step 3 for the first photo: 3.47 MB down to 137 KB at 54% quality and 2,400 by 1,800 pixels. Screenshot of the full tool on dokurapi.com with a synthetic test file, 14 October 2026.

The quality steps explain why results often land well below the target. The tool stops at the first step that fits, so a photo that needs 60% quality is saved at 54%, the next step down. That leaves room in your budget, which is useful when one photo in the set is harder to compress than the others.

Dokurapi Photo to PDF tool with three compressed photos listed, foto-1-200kb.jpg 137 KB, foto-2-200kb.jpg 155 KB and foto-3-200kb.jpg 137 KB, and the status line Done. 430 KB
Route B on the live tool: the three compressed photos make a 430 KB PDF, under the 470,000-byte safe target for a 500 KB limit. Screenshot of the full tool on dokurapi.com with synthetic test files, 14 October 2026.
Bar chart of sizes in bytes: foto-1.jpg 3,471,789 to 136,931, foto-2.jpg 3,089,217 to 154,892, foto-3.jpg 990,441 to 136,571, and the three-page PDF 7,553,147 to 430,074 after 200 KB compression
Every file before and after. The PDF shrinks by the same proportion as the photos inside it. Chart of measured data.

The three compressed photos added up to 428,394 bytes, and the PDF was 430,074 bytes, again about 1,700 bytes of overhead. That confirms the rule: add the sizes of your compressed photos, add 2 KB, and you know the PDF size before you make it.

Keep the pages readable

A smaller file is only useful if the person reviewing it can still read it. Before you combine the photos, open each compressed JPG and zoom to 100%. Check the smallest print you care about, such as a certificate number, a signature or a stamp. Blocky edges around letters mean the quality went too low for that page.

  • Crop before you compress. Removing the table or floor around a document means every remaining pixel carries information.
  • Shoot in good light. Shadows and grain add noise, and noise costs bytes.
  • Start from the original camera file. A photo sent through a chat app has already been compressed once.
  • Give hard pages more budget. If one page has dense small text, compress it to a higher custom target and the simple pages to a lower one, as long as the total stays inside the safe target.

For tight per-file limits, the compress photo to 200 KB guide shows how far quality can drop before text suffers. The same judgement applies to each page of your PDF.

Page order, page size and the 10-photo limit

Photo to PDF puts one photo on each A4 page, scaled to fit and centred, in the order of the list. Use the arrow buttons to move a photo up or down before you press Create PDF. The tool accepts up to 10 photos per PDF and tells you how many were left out if you add more.

If you need more than 10 pages, make two PDFs and join them with Merge PDF. Merging copies the pages as they are, so the merged file is roughly the sum of the two parts. The merge PDF guide explains naming and order for multi-part submissions, and the page order checklist helps you catch a swapped page before a reviewer does.

Because every page is A4, a landscape photo is placed across the width with white space above and below. That white space costs almost nothing in bytes. Only the photo data counts.

If the PDF is still too big

If the PDF still exceeds the limit, go back one step instead of compressing the PDF itself. Compress the largest photo again with a lower custom target, or compress all of them to the next budget down, then rebuild the PDF. You keep control of each page this way.

Compressing the finished PDF with Compress PDF also works, because Dokurapi renders every page again as a JPG at a fixed resolution. For a photo PDF this usually shrinks the file a lot, but it also lowers the resolution of every page to about 86 dots per inch at most. That is fine for a photo of an ID card and risky for a page of small print. The guide on files that are still too big walks through the other causes, and how to check file size before upload shows how to read the exact byte count the form will see.

None of these steps sends your photos anywhere. The explanation of how the browser tools work describes what stays on your device.

Frequently asked questions

How do I compress JPG to PDF?
Compress each JPG first with the Compress Photo tool, then combine the smaller JPGs with Photo to PDF, then check the PDF size. Converting first does not reduce the size, because the PDF keeps each JPG unchanged.
Does converting JPG to PDF make the file smaller?
No. In our test three photos of 7,551,447 bytes made a PDF of 7,553,147 bytes. The PDF stores each JPG as it is and adds only about 1,700 bytes of structure for three pages.
How big should each photo be for a 500 KB PDF?
Take the 470,000-byte safe target, subtract about 2,000 bytes, and divide by the number of photos. For three photos that is 156,000 bytes each, which you get by typing a custom target of 165 KB.
Why is my PDF bigger when I use PNG files?
Photo to PDF embeds PNG files as PNG, which is lossless and usually much larger than JPG. Convert the PNG to JPG with the Compress Photo tool before you make the PDF.
How many photos can go into one PDF?
Up to 10 photos per PDF, one photo per A4 page. For more pages, make two PDFs and join them with Merge PDF.
Can I compress the PDF after making it instead?
Yes, Compress PDF renders every page again as a JPG at no more than about 86 dpi. It is quick but lowers the resolution of every page, so compressing the photos first gives you more control.
Are my photos uploaded to a server?
No. Compress Photo, Photo to PDF and Check PDF Size all run in your browser tab. The files are read and written on your device.
Why did my photo come out smaller than the target?
The tool lowers JPG quality in steps of 10 points and stops at the first step that fits the safe target, so the result is often well under the number you chose.

Sources

  1. pdf-lib: PDFDocument.embedJpg and embedPng
  2. NIST: Prefixes for binary multiples
  3. MDN: HTMLCanvasElement.toBlob() and the quality parameter

Need help?Result not quite right, or unsure about a form rule? Ask Dokurapi support on WhatsApp. Please do not send personal documents in chat.

Chat on WhatsApp

Related articles

Try Dokurapi for Free

No account needed. Pick a tool, drop in a file, and download the result, free.