Introduction

QRGen is an open-source (Apache-2.0) SDK for scanning barcodes, QR codes and ID documents, and for generating and parsing barcodes, on the web, mobile, desktop and server.

Edit on GitHub

QRGen is an open-source barcode, QR code and ID scanning SDK. It gives you a ready-made camera scanner you can drop into a page, a lower-level scanning API for custom interfaces, parsers that turn scanned text into structured data, and a barcode generator. Decoding runs on the device in WebAssembly (or the platform’s native engine on iOS and Android), so camera frames never leave the user’s device.

The whole project is free and open source under the Apache License 2.0, including for commercial products. It was created by Rockyljewell. There are no license keys, usage limits or telemetry.

What’s in the box

Piece What it does Start here
Pre-built scanner UI <qrgen-scanner> web component with viewfinder, highlights, torch, camera switch, zoom and success feedback. Wrappers for React and Vue. Web Components
BarcodeScanner API Camera scanning without UI: bring your own <video>, get scan, frame and track events. JavaScript
Batch scanning Track many codes with stable ids, choose from an accessible results list, count decoded items in view. Batch scanning
ID scanning Read the PDF417 on North American driver licenses and ID cards and parse it into name, birth date, expiry and address. ID scanning
Image scanning Decode codes in files, photos, canvases, clipboard images and URLs, several per image. Image scanning
Generator Create any of 26 symbologies as SVG, PNG or a data URL, including GS1 data. Barcode generation
Parsers Understand what was scanned: URLs, Wi-Fi, contacts, events, payments, product codes, GS1 element strings, GS1 Digital Link and AAMVA. Parsers
CLI and REST API qrgen scan, qrgen generate and qrgen serve, plus a Docker image, so any language can scan and generate over HTTP. CLI, REST API & Docker
Native SDKs Swift, Kotlin, React Native, Flutter, .NET and Python packages that share the same symbology ids, result shape and parsers. Platforms
Agent Skills Instructions that teach coding agents (Claude Code and others) to integrate QRGen correctly. Agent Skills

You can try the scanner in your browser on the demo page.

Platforms

Every package follows the same cross-platform contract: the same lowercase symbology ids, the same result object, the same option names and the same error codes. Code and knowledge carry over between platforms.

Platform Package How it scans Guide
Web (vanilla JS / TypeScript) qrgen-sdk (npm) zxing-cpp in WebAssembly, in a Web Worker JavaScript, Web Components, Script tag & CDN
React, Next.js qrgen-sdk/react Same web engine React, Next.js
Vue, Nuxt qrgen-sdk/vue Same web engine Vue & Nuxt
Angular qrgen-sdk/elements Same web engine Angular
Svelte, SvelteKit qrgen-sdk/elements Same web engine Svelte & SvelteKit
iOS, macOS QRGenKit (Swift Package) Native iOS
Android dev.qrgen:qrgen-android Native Android
React Native qrgen-react-native Native camera, or the embed page in a WebView React Native
Flutter qrgen_flutter See the guide Flutter
.NET / MAUI QRGen.Net See the guide .NET
Capacitor, Ionic qrgen-sdk Web engine in the app’s WebView Capacitor & Ionic
Cordova qrgen-sdk Web engine in the app’s WebView Cordova
Electron qrgen-sdk Web engine in the renderer, qrgen-sdk/node in the main process Electron
Tauri qrgen-sdk Web engine in the system WebView Tauri
Titanium Hosted embed page WebView guide Titanium
Node.js, Bun qrgen-sdk/node WebAssembly, loaded from node_modules Node.js
Command line qrgen (npm bin) Node.js CLI
Any language over HTTP qrgen serve, Docker image Node.js REST API & Docker
Python qrgen-sdk (PyPI) zxing-cpp, OpenCV for webcams Python
Linux, Raspberry Pi Any of the above CLI, REST, Python or a kiosk browser Linux & Raspberry Pi
Any other WebView Hosted embed page Web engine, events over a message bridge Embed bridge

How it works

On the web, QRGen wraps zxing-cpp, a mature C++ barcode library, compiled to WebAssembly by zxing-wasm. The BarcodeScanner opens the camera with getUserMedia, crops each frame to the visible scan area, and decodes it in a Web Worker so the page stays responsive. Results go through a duplicate filter, trigger optional beep and vibration feedback, and arrive as plain JSON objects.

The decoder (zxing_reader.wasm, about 400 KB gzipped) is downloaded once and cached. By default it loads from jsDelivr; you can self-host it for offline apps or strict networks. The generator uses a separate zxing_writer.wasm that is only fetched when you generate a barcode.

Next steps

  • Quick start: a working scanner in under 15 lines.
  • Installation: package managers, CDN, self-hosting and Content Security Policy.
  • Core concepts: symbologies, scan modes, the result object and duplicate filtering.
Esc

Share this page

Introduction · Docs | QRGen

Star QRGen on GitHub Add a "Powered by QRGen" badge