pdf-lib vs PDFKit vs jsPDF vs pdfmake

Four open-source JavaScript PDF libraries with very different sweet spots — the versatile pure-JS engine that uniquely both creates AND modifies existing PDFs in browser + Node, the original low-level Node.js generation engine, the most popular browser-first client-side generator, and a declarative layout-based engine for structured documents — compared on generation, modification, browser/Node support, and API style.

pdf-libPDFKitjsPDFpdfmake
Free tier noteThe most versatile free JavaScript PDF library — pdf-lib is a pure-JavaScript (no native dependencies) MIT-licensed engine that runs in both the browser and Node.js and uniquely both creates new PDFs AND modifies existing ones: draw text, vector paths, and images; embed fonts; fill and read AcroForm fields; merge, split, rotate, copy, and remove pages; and add attachments. Modern TypeScript-first async API, ~7k+ GitHub stars, actively maintained by Hopding. No paid tier, no SaaS — install with npm and use it forever.The original low-level PDF-generation engine for Node.js — PDFKit is a mature MIT-licensed library (since 2012, ~9k+ GitHub stars) for generating PDFs programmatically from scratch: vector graphics, text with embedded TrueType/OpenType fonts, images, gradients, annotations, and links. It is the foundation that higher-level libraries like pdfmake build on top of. Originally Node.js-focused (uses some Node APIs) with browser builds available via bundlers. No paid tier, no SaaS — the low-level primitives for full control over PDF layout.The most popular JavaScript PDF library — jsPDF is a browser-first MIT-licensed library (~30k+ GitHub stars) for generating PDFs directly client-side in the browser with no server round-trip: text, images, shapes, form fields, and HTML-to-PDF via plugins (html2canvas, autotable, svg). Works in Node.js too, but the browser is its sweet spot. A rich plugin ecosystem extends it for tables, SVG, and HTML. No paid tier, no SaaS — the default pick for client-side PDF generation.The declarative layout-based PDF library — pdfmake is an MIT-licensed engine (~12k+ GitHub stars) built on top of PDFKit where you describe a document as a JSON object (content array + styles + layout rules) and get a PDF, instead of imperatively drawing on a canvas. Ideal for structured documents like reports, invoices, tables, and multi-column layouts with automatic pagination and flow. Runs in browser and Node.js. No paid tier, no SaaS — the pick when you want to declare what the document looks like, not how to draw it.
Bandwidthn/an/an/an/a
Buildsn/an/an/an/a
RequestsUnlimited use — MIT npm package, no quotasUnlimited use — MIT npm package, no quotasUnlimited use — MIT npm package, no quotasUnlimited use — MIT npm package, no quotas
Custom domainsn/an/an/an/a
Paid from$0/mo$0/mo$0/mo$0/mo
Generosity ★34343434
Last verified2025-09-012025-09-012025-09-012025-09-01
Visit sitepdf-lib ↗PDFKit ↗jsPDF ↗pdfmake ↗

Data verified 2025-09-01.