JavaScript QR code libraries

Updated Nov 2026

JavaScript QR code libraries encode text or a URL as a QR code and render it as an image, an SVG, or terminal text. An encoder builds the matrix of dark and light modules before a renderer draws it. These libraries let apps print payment links, sign-in codes, and ticket codes that a phone camera can scan.

Popularity

node-qrcode has the most monthly downloads in this comparison, at 155.4M.

LibraryMonthly downloadsStarsLast releaseLicense
qrcode
158.7M
8.2KAug 2024MIT
qrcode.react
55.3M
4.3KDec 2024ISC
toqr
45.1M
3Feb 2026MIT
uqr
38.3M
795Apr 2026MIT
qrcode-terminal
32.1M
1.4KMar 2018Apache-2.0
qrcode-generator
30.9M
2.4KAug 2025MIT
zxing-wasm
20.2M
298Nov 2026MIT
antd
19.9M
100.3KNov 2026MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Libraries and code examples

Encodes QR images in Node or browsers with automatic mixed-mode segmentation.

Downloads / mo
158.7M
Stars
8.2K
Last release
1.5.4
License
MIT

Strengths

  • Optimizes mixed content automatically. Automatic segments combine encoding modes to reduce the symbol size.
  • Accepts raw byte payloads. Pass typed arrays or Buffers instead of converting bytes to strings.

Limitations

  • Strings can change binary payloads. Use byte arrays or Buffers to preserve binary input.
  • Kanji optimization needs a helper. Supply toSJISFunc for dedicated Kanji-mode encoding.

Quickstart

From README.md
$ npm install qrcode@1.5.4
const QRCode = require('qrcode');
QRCode.toString('Hello world', { type: 'terminal' }, (error, output) => {
  if (error) throw error;
  console.log(output);
});

qrcode examples

From open-source projects on GitHub

Generates QR codes as a React component.

Downloads / mo
55.3M
Stars
4.3K
Last release
4.2.0
License
ISC

Quickstart

From README.md
$ npm install qrcode.react@4.2.0 react@19.2.0 react-dom@19.2.0
import { QRCodeSVG } from 'qrcode.react';

export default function App() {
  return <QRCodeSVG value="Hello world" />;
}

qrcode.react examples

From open-source projects on GitHub

Encodes QR codes in a small package.

Downloads / mo
45.1M
Stars
3
Last release
0.1.1
License
MIT

Quickstart

From toqr.d.ts
$ npm install toqr@0.1.1
import { toQR } from 'toqr';
console.log(toQR('Hello world'));

toqr examples

From open-source projects on GitHub

Generates QR codes in any runtime as ANSI, Unicode, or SVG.

Downloads / mo
38.3M
Stars
795
Last release
0.1.3
License
MIT

Quickstart

From README.md
$ npm install uqr@0.1.3
import { renderSVG } from 'uqr';
console.log(renderSVG('Hello world'));

uqr examples

From open-source projects on GitHub
export async function printQRCode(url: string, { showURL = false }: { showURL?: boolean } = {}): Promise<void> {
  const { renderUnicodeCompact } = await import('uqr')
  const caption = showURL ? `\n${centerBlock(styleText('cyan', url), url.length)}` : ''
  // eslint-disable-next-line no-console
  console.log(`\n${centerBlock(renderUnicodeCompact(url))}${caption}\n`)
}

qrcode-terminal

Prints QR codes in the terminal.

Downloads / mo
32.1M
Stars
1.4K
Last release
0.12.0
License
Apache-2.0

Quickstart

From README.md
$ npm install qrcode-terminal@0.12.0
const qrcode = require('qrcode-terminal');
qrcode.generate('Hello world');

qrcode-terminal examples

From open-source projects on GitHub

qrcode-generator

Builds QR matrices and returns SVG, image-tag or text representations.

Downloads / mo
30.9M
Stars
2.4K
Last release
2.0.4
License
MIT

Strengths

  • Exposes individual QR modules. Inspect matrix size and dark cells after building the symbol.
  • Can auto-select symbol size. Pass a zero type number to select the QR version automatically.

Limitations

  • Multibyte text needs encoder configuration. Configure stringToBytes for multibyte character encodings.

Quickstart

From README.md
$ npm install qrcode-generator@2.0.4
const qrcode = require('qrcode-generator');
const qr = qrcode(0, 'M');
qr.addData('Hello world');
qr.make();
console.log(qr.createSvgTag());

qrcode-generator examples

From open-source projects on GitHub
() => {
  const qr = qrcode(0, 'M');
  qr.addData(REPO_URL);
  qr.make();
  return qr.createSvgTag({ cellSize: 4, margin: 0, scalable: true });
}

Packages ZXing-C++ as a typed WebAssembly module.

Downloads / mo
20.2M
Stars
298
Last release
3.1.7
License
MIT

Quickstart

From README.md
$ npm install zxing-wasm@3.1.7
const { readFileSync } = require('node:fs');
const { prepareZXingModule, writeBarcode } = require('zxing-wasm/writer');
const bytes = new Uint8Array(readFileSync(require.resolve('zxing-wasm/writer/zxing_writer.wasm')));
prepareZXingModule({ overrides: { wasmBinary: bytes.buffer } });
writeBarcode('Hello world', { format: 'QRCode' }).then(output => console.log(output.svg));

zxing-wasm examples

From open-source projects on GitHub

Provides an enterprise-class React UI component library.

Downloads / mo
19.9M
Stars
100.3K
Last release
6.7.1
License
MIT

Quickstart

From README.md
$ npm install antd@6.7.1 react@19.2.0 react-dom@19.2.0
import { QRCode } from 'antd';

export default function App() {
  return <QRCode value="Hello world" />;
}

antd examples

From open-source projects on GitHub

FAQ

qrcode suits Node.js and browser code that needs PNG, data URL, SVG, or terminal output. qrcode.react suits React apps that render a QR code as a component. qrcode-terminal suits command-line tools that print a code in the terminal.

qrcode.react renders a QR code as a React component with an SVG or canvas renderer. Apps that already use Ant Design can use the QR code component in antd.

uqr generates QR codes in any JavaScript runtime as SVG, ANSI, or Unicode text. It also returns the raw QR matrix for custom renderers.

zxing-wasm packages the ZXing-C++ barcode library as a WebAssembly module. Its writer supports QR codes and other barcode formats, with SVG, PNG, and terminal text output.

qrcode-generator is a low-level QR code object with explicit steps to add data and build the code. It returns SVG, ASCII, GIF, canvas, or matrix output.

For coding agents

Found your QR code library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official