Developers & agents
QR code libraries compared
For generation: qrcode on npm (MIT) and segno or python-qrcode in Python cover most needs; qr-code-styling adds design. For decoding: zxing-cpp is the actively maintained engine with bindings everywhere; zbar is fast but aging; quirc is tiny for embedded. Generation and decoding are different problems: most projects need one library from each column.
Two ecosystems, not one
Generating a QR code and reading one are unrelated problems that happen to share a name. Generation is deterministic maths: encode, add Reed–Solomon codewords, mask, render. Decoding is computer vision: find the code in a noisy image, correct perspective, sample modules, undo the maths. Libraries almost never do both well, so most real projects pick one from each table.
Generation libraries
| Library | Language | Licence | Notes |
|---|---|---|---|
qrcode (npm) |
JavaScript | MIT | Pure JS, no native deps, PNG/SVG/terminal output. The default choice in Node. |
qrcode.react |
React | ISC | Renders to canvas or SVG as a component. |
qr-code-styling |
JavaScript | MIT | Module shapes, gradients, logos, the styling layer others lack. |
qrcode (PyPI) |
Python | BSD | Long-standing default; PIL and SVG output. |
segno |
Python | BSD | Pure Python, no dependencies, Micro QR support, very complete spec coverage. |
| ZXing (Java) | Java/Android | Apache-2.0 | The historic reference; the Java project is in maintenance mode. |
go-qrcode |
Go | MIT | Simple PNG generation. |
@useqr/core |
TypeScript | MIT | UseQR's own engine: matrix, styled SVG, typed payload builders, decode-verify loop. |
Generation is a solved problem, so choose on the secondary axes: native dependencies (none, ideally. It is what makes a library work in serverless), SVG output (needed for print), and whether styling is in scope.
Decoding libraries
| Library | Language | Licence | Notes |
|---|---|---|---|
| zxing-cpp | C++ | Apache-2.0 | The actively developed rewrite of ZXing; bindings for Python, WASM, iOS, Android. |
| zxing-wasm | Browser/Node | MIT wrapper | WebAssembly build of zxing-cpp; same engine in browser and server. |
| zbar | C | LGPL-2.1 | Fast and battle-tested; the original project stalled, a community fork carries it. |
| pyzbar | Python | MIT | Thin wrapper over zbar; needs the zbar shared library installed. |
| quirc | C | ISC | A few thousand lines, no dependencies, built for embedded and microcontrollers. |
| jsQR | JavaScript | Apache-2.0 | Pure-JS decoder; convenient, but development has largely stopped. |
Maintenance status is the honest differentiator here. The original Java ZXing announced maintenance mode; jsQR has been quiet for years; zbar survives through a fork. zxing-cpp is the one decoding engine with clearly active development and first-party bindings on every platform, which is why UseQR uses zxing-wasm for its scanner, its decode API and its CI. A deeper decoder comparison: ZXing vs quirc vs zbar.
Pick by use case
| You are building | Generation | Decoding |
|---|---|---|
| Node service or script | qrcode (npm) |
zxing-wasm |
| React front-end | qrcode.react or qr-code-styling |
BarcodeDetector + zxing-wasm (pattern) |
| Python pipeline | segno or qrcode |
zxing-cpp (pip install zxing-cpp) |
| Android/iOS app | platform libraries or ZXing ports | zxing-cpp bindings / ML Kit |
| Microcontroller | custom (generation is small) | quirc |
| No dependencies allowed | keyless API | POST /api/v1/decode |
The gap no library fills alone
No generation library can tell you whether its own styled output still scans. That requires rasterising the result and running a real decoder over it. If you generate codes that will be printed, wire generation and decoding together into a decode-verify loop; it is a few lines once you have one library from each table.
FAQ
What is the best QR code library for JavaScript?
qrcode on npm for plain generation: pure JS, MIT, no native dependencies. Add qr-code-styling if you need module shapes, gradients or logos, and zxing-wasm if you also need to decode.
What is the best QR code library for Python?
segno and qrcode are both solid BSD-licensed generators; segno is pure Python with unusually complete spec coverage. For decoding, zxing-cpp's official Python binding is the actively maintained choice over pyzbar.
Is ZXing still maintained?
The original Java ZXing project is in maintenance mode, but zxing-cpp (a C++ rewrite with Python, WebAssembly and mobile bindings) is actively developed and is the practical successor for new projects.
Can one library generate and decode QR codes?
A few try, but the strong tools specialise: generation is deterministic encoding while decoding is computer vision. The common production setup is one generator plus one decoder, connected by a verify step in tests.
Try it: free, no signup
Related
- ZXing vs quirc vs zbar, The three open-source QR decoding engines compared: heritage, licences, platform reach and maintenance reality. Which decoder to build on in 2026.
- Generate a QR code in JavaScript and React, For a QR code in a browser or React app, either point an <img> at the keyless API (one line, no dependency), or use a client-side library such as qrcode…
- Generate a QR code in Python, Two options: call the keyless HTTP API with requests, which needs no dependencies beyond requests and no key, or use the qrcode library locally when you…
- A free QR code API with no key, UseQR's REST API needs no signup, no API key and no SDK. GET /api/v1/qr?data=hello returns a PNG. The shortest form is /q/hello.png, which drops straight…