JPG to PDF Converter
Operator: Abdulla Al Fahad. How tools are built and checked
Receipts photographed on a phone, a scanner's pile of JPGs, screenshots of a chat, a folder of PNG diagrams: the JPG to PDF Converter puts images like these onto the pages of a single PDF, one image per page, in the order you arrange them. Each page can match the image exactly or be a standard A4 or US Letter sheet with the picture fitted inside optional margins, and photos taken with the phone turned sideways come out upright because the EXIF orientation is read and applied.
Up to 100 images can be added; a numbered list shows the order, with ▲ and ▼ buttons to move an image and ✕ to drop it. The PDF is built when you click Create PDF and is named after the first image.
Key features
- Up to 100 images in one PDF, ordered with the ▲, ▼ and ✕ buttons.
- JPGs without an EXIF rotation and PNGs are embedded byte for byte, so originals keep their quality and the PDF is about the sum of the files.
- Page size that matches each image, or A4 and US Letter with portrait, landscape or per-image orientation and 0, 0.5 or 1 inch margins.
How images are placed on pages
PDF natively stores JPEG data and Flate-compressed raw pixels, which is what a PNG unpacks to. A JPEG whose EXIF Orientation tag is 1 or absent is therefore embedded as it is, and a PNG is embedded with its transparency intact. PDF viewers ignore EXIF, however, so a JPEG whose tag says "rotate 90°" would appear on its side; such files are decoded by the browser with the orientation applied, drawn onto a white canvas and re-encoded as JPEG at 92% quality.
WebP, GIF, BMP, AVIF and HEIC have no PDF equivalent, so they take the same decoding route and are stored as PNG. Any image that goes through the decoder is also reduced so that its longest side is at most 4000 pixels; images embedded directly are never resized. A warning counts the re-encoded images, because those pages are no longer byte-for-byte copies of the files you added.
With Page size set to Match each image, every pixel becomes one PDF point, so a 1200 × 1600 photo makes a page 1200 × 1600 points (16.7 × 22.2 inches) plus any margin. With A4 (595 × 842 points) or US Letter (612 × 792), the page is portrait or landscape by your choice or, with Follow each image, whichever suits the image's proportions, and the image is scaled up or down to fill the area inside the margin (none, 0.5 inch or 1 inch) and centred.
How it works
Each file is read into memory and its first bytes are inspected: FF D8 marks a JPEG and 89 50 4E 47 a PNG. A JPEG with orientation 1 and any PNG are passed straight to pdf-lib's embedJpg or embedPng. Everything else is handed to createImageBitmap with imageOrientation set to from-image, which applies the rotation while decoding; the bitmap is drawn onto a canvas, scaled down to 4000 pixels if necessary, and exported with toBlob as JPEG at quality 0.92 or as PNG.
A new PDF document is created and one page is added per image. In Match each image mode the page is the image's pixel size in points plus twice the margin, capped so no side exceeds 14,400 points; for A4 or Letter the orientation follows your setting or the image's shape, and the picture is scaled with pdf-lib's scaleToFit to the area inside the margins and drawn centred.
Common use cases
- Combining photos of a paper receipt trail into one PDF for an expense claim that accepts a single attachment.
- Turning a batch of scanner JPGs into a multi-page PDF of a signed contract, each page on A4 so they print at the right size.
- Submitting identity documents photographed on a phone to a portal that wants a PDF rather than loose pictures.
- Converting a folder of WebP product shots downloaded from a web store into a PDF the supplier can open anywhere.
How to use this tool
- Select the images, several at a time if you like; they queue in a numbered list that is also the page order.
- Use ▲ and ▼ to reorder and ✕ to remove an image; drop more files to add them to the end of the list.
- Choose the Page size: Match each image for screen viewing, or A4 or US Letter for printing, with an Orientation (Follow each image for a mixed set) and a Margin of None, Small (0.5 in) or Large (1 in).
- Create PDF, confirm that the pages out chip equals the number of images and that the first page is upright, then Download .pdf.
Example
Three images added in this order
1. receipt-front.jpg 3024 × 4032 as displayed, EXIF orientation 6
2. receipt-back.jpg 4032 × 3024, no EXIF rotation
3. parking.png 1080 × 1920
Page size: A4 Orientation: Follow each image Margin: Small (0.5 in)Result
receipt-front.pdf
3 files in · 3 pages out · 8.4 MB → 6.9 MB
One image was re-encoded by the browser (rotated photos and formats other than JPG and PNG), so it is no longer a byte-for-byte original.
Page 1 A4 portrait decoded, turned upright, reduced to 3000 × 4000, JPEG at 92%
Page 2 A4 landscape original JPEG bytes embedded, fitted and centred
Page 3 A4 portrait PNG embedded unchanged, fitted inside the marginsTips for best results
- Add images in the order you want them, or fix the order with the ▲ and ▼ buttons before clicking Create PDF; the numbered list is the page order.
- Choose Follow each image for a mixed set of portrait and landscape photos: each gets the page orientation that fits it, instead of landscape shots being shrunk onto a portrait sheet.
- Rename the first image if you care about the PDF's name: receipts-2026-10.jpg gives receipts-2026-10.pdf, and the same stem is written into the PDF's Title field.
Edge cases to watch
A PNG is embedded in full. A 20 MB screenshot at 5000 × 3000 pixels becomes 20 MB of PDF, whereas the same picture as a JPG would be a few hundred kilobytes; convert large PNG photos to JPG first if size matters.
WebP and AVIF grow rather than shrink. They are stored as PNG, so a 200 KB WebP photo can turn into a 3 MB page; save such images as JPG before converting when the PDF has to be emailed.
Margins add to the page in Match each image mode: a 0.5-inch margin around a 600 × 800 photo makes a 672 × 872 point page, so the page is no longer the image's exact size.
Common errors and how to fix them
- Add at least one image.
- Create PDF was clicked with an empty list. Files that are not images are filtered out as they are added, so after a mixed drop check that something is left.
- "IMG_0042.HEIC" could not be decoded by this browser. Convert it to JPG or PNG and try again.
- HEIC and HEIF photos decode in Safari but not in Chrome or Firefox. Export them as JPG from the Photos app, set the iPhone camera to Most Compatible, or open this page in Safari.
- This tool accepts JPG, PNG, WebP, GIF, BMP, AVIF or HEIC images, up to 100 files. "contract.pdf" has a different type.
- Nothing you dropped was an image. To combine existing PDFs use Merge PDF, and to turn a PDF's pages into pictures use PDF to JPG.
- The files add up to more than 200MB. Remove some and try again.
- The images in the list exceed the limit for a single run. Remove a few with ✕, or build the PDF in two halves and join them with Merge PDF.
Best practices
- Photograph documents in good light and crop them before converting; the tool places the image exactly as it is and does not straighten, crop or enhance.
- Standardise on JPG for photographs and scans and PNG for screenshots and diagrams; anything else is best converted to one of those first, so every page is embedded without re-encoding.
- Check the first-page preview for orientation before downloading: if a photo appears sideways there, its EXIF tag does not match its pixels and it needs rotating in an editor that rewrites them.
Why some photos are re-encoded and what it costs
Cameras and phones rarely rotate the pixels when you hold them sideways; they store the sensor's image as it came and write an Orientation tag into the EXIF block telling viewers how to turn it. A PDF image object has no such tag, so a viewer would show the raw sensor orientation. The only ways to get an upright page are to add a rotation to the PDF drawing instructions or to rewrite the pixels; this tool rewrites, by asking the browser to decode the JPEG with its orientation applied and encoding the result again.
That second encoding is done at 92% JPEG quality, which is visually indistinguishable for a photograph but is still a generation of loss. The decoder route also enforces a 4000-pixel limit on the longest side, because a 12-megapixel photo decoded to raw pixels occupies about 48 MB of memory and a batch of them would exhaust a phone browser.
Frequently asked questions
Do my photos keep their original quality?
JPGs that do not need rotating and PNGs are copied into the PDF without being decoded, so yes. Rotated photos and WebP, GIF, BMP, AVIF or HEIC files are decoded and re-encoded (JPEG at 92% or lossless PNG).
Why is the PDF so much bigger than my WebP or AVIF files?
PDF cannot store those formats, so they are converted to PNG, which is lossless and far less compact for photographs. Save them as JPG before converting if the PDF size matters.
Can I put two or more images on one page?
No; the tool makes one page per image. Combine pictures into one image in an editor first, or print the finished PDF with a 2-up or 4-up layout.