JPG vs PDF: The Guide
JPG (Joint Photographic Experts Group) and PDF (Portable Document Format) serve fundamentally different purposes in the digital document ecosystem — yet the need to convert between them is one of the most common everyday computing tasks. Understanding why you need PDF, and what the conversion actually does, helps you use this tool to its full potential.
The Core Difference
JPG is a raster image format — it stores pixels. PDF is a document container format — it stores pages that can contain images, text, vectors, and metadata. Converting JPG to PDF doesn't change the image; it wraps it in a document structure that systems, institutions, and software can reliably open, print, and archive.
Why PDF is the Universal Standard
Adobe invented PDF in 1992 to solve a real problem: documents looked different on different computers because every system had different fonts, margins, and rendering engines. PDF solved this by embedding everything — fonts, images, layout — into a single self-contained file that renders identically on every device and OS.
Today, PDF is an ISO international standard (ISO 32000). It is the required format for government submissions, legal filings, academic journals, bank statements, medical records, and most official digital documents worldwide. When a government portal asks for your "Aadhaar in PDF", a university says "submit assignments as PDF", or a visa application requires "passport scan in PDF", there is no substitute — JPEG simply won't do.
How JPG to PDF Conversion Works
JPG to PDF conversion is conceptually simple: create a new PDF document, create a page of the specified dimensions, embed the JPG image data into that page, and save the PDF. The image is not re-compressed or degraded in the process — it is embedded as-is into the PDF container (for JPEG and PNG sources). This is why HQCalc's converter can operate entirely in the browser using pdf-lib, an open-source JavaScript library that speaks the PDF specification natively.
For non-JPEG/PNG formats (WebP, BMP, GIF, TIFF), the browser's Canvas API first renders the image and re-encodes it as JPEG at your chosen quality setting before embedding. This is necessary because PDF natively supports JPEG and PNG image streams, but not WebP or BMP.
The Privacy Argument: Why Browser-Based Matters
Many popular online converters (ILovePDF, Smallpdf, Adobe Online) upload your files to remote servers for processing. This means your images — which may contain ID cards, medical reports, bank statements, or private photos — travel across the internet to a third party's infrastructure. Even with HTTPS encryption in transit and deletion policies post-processing, you are trusting a third party with sensitive data.
HQCalc's converter runs entirely in your browser using the Web API and the pdf-lib library. Your image bytes are read by the browser's FileReader API, processed by pdf-lib's JavaScript engine, and the resulting PDF bytes are written to an in-memory Blob URL. At no point do your files leave your device. For KYC documents, medical scans, financial records, or anything sensitive, this is the only truly private approach.
Choosing the Right Page Size
Fit Image (default) creates PDF pages that exactly match each image's pixel dimensions converted to PDF points (72 points = 1 inch). A 3000×4000px image at 300 DPI would produce a 10×13.3 inch page. Use this when the image is the document and you want no scaling or cropping.
A4 (210×297mm, 595×842pt) is the world standard for office documents outside North America. Use A4 when submitting to government portals, academic institutions, or anywhere that expects a standard paper size. Images are scaled proportionally to fit within the page with your chosen margin.
Letter (8.5×11 inches, 612×792pt) is the US/Canada standard. Use this when submitting to US institutions, companies, or printing on American paper. Legal (8.5×14 inches) is used for legal documents in North America.
Margins matter for printing. A "None" margin PDF will print image content right to the edge of the page, which most printers cannot do (they have unprintable border zones of ~5mm). Use Small or Medium margin for anything intended for physical printing to ensure nothing gets cut off.