ZXing JS

Package

JavaScript library that decodes QR codes and barcodes in browsers and Node.js

Price
Free, open source
Access
None, runs locally

About

ZXing-JS is a TypeScript port of the ZXing barcode library. It decodes QR Code, Data Matrix, Aztec, PDF 417 and common 1D barcodes such as EAN, UPC and Code 128, locally in the browser or Node.js. The project is in maintenance mode.

What you can do with it

  • Decode QR codes from a webcam or phone camera in the browser
  • Read EAN, UPC or Code 128 barcodes in a Node.js script
  • Decode Data Matrix, Aztec or PDF 417 codes in JavaScript or TypeScript

Get started

  1. Run npm i @zxing/library
  2. Build a luminance source from your image data

Example

import { MultiFormatReader, BinaryBitmap, HybridBinarizer, RGBLuminanceSource } from "@zxing/library";

// pixels: Int32Array of grayscale or RGB values, width and height of the image
const source = new RGBLuminanceSource(pixels, width, height);
const result = new MultiFormatReader().decode(new BinaryBitmap(new HybridBinarizer(source)));
console.log(result.getText());

Details

Hosting
Runs locally
Available in
Worldwide
Official SDKs
JavaScript/TypeScript
MCP server
None

Tasks

Alternatives

Other tools for the same tasks.

Last checked on .