Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

Javascript-Barcode-Reader

> 编程语言
Open source

Simple and Fast Barcode decoder with support of Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8 barcodes in java

197 stars0 likes3 views
WebsiteGitHub

About

Simple and Fast Barcode decoder with support of Code128, Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8 barcodes in java

Javascript-Barcode-Reader

Simple & Fast Barcode decoder for Browsers and Node.js capable of reading multiple barcode formats including Code128 (UCC/EAN-128), Code93, Code39, Standard/Industrial 2 of 5, Interleaved 2 of 5, Codabar, EAN-13, EAN-8, UPC-A, UPC-E, MSI, and Pharmacode.

Try now

https://codesandbox.io/s/javascript-barcode-reader-liium

Available decoders

  • EAN-13
  • EAN-8
  • UPC-A
  • UPC-E
  • Code-39
  • Code-93
  • Code-2of5
    • standard
    • Interleaved
  • Codabar
  • Code-128 (UCC/EAN-128)
  • MSI
  • Pharmacode

Features

  • Pure JavaScript/TypeScript implementation
  • Works in both Node.js and browser environments
  • Supports multiple barcode formats
  • Adaptive thresholding for challenging images
  • Single-pass mode for faster decoding
  • Automatic barcode region detection
  • Automatic rotation detection and correction
  • TypeScript support

Installation

Recommended way to install is by using package manager (npm, yarn etc):

bash
npm i javascript-barcode-reader

or use cdn:

xml

or download manually:

javascript-barcode-reader

Usage

Node.js

…

Browser

javascriptBarcodeReader will be available as global in Browsers.

javascript
javascriptBarcodeReader({
  /* Image ID || HTML5 Image || HTML5 Canvas || HTML5 Canvas ImageData || Image URL */
  image: source,
  barcode: 'code-2of5',
  // barcodeType: 'industrial', // for code-2of5: 'industrial' or 'interleaved'
  options: {
    // useAdaptiveThreshold: true // for images with shaded/ gradient portions
    // singlePass: true
    // detectRotation: true // auto-detect and correct rotation
    // locateBarcode: true // auto-locate barcode region
  },
})
  .then((code) => {
    console.log(code)
  })
  .catch((err) => {
    console.log(err)
  })

Supported Barcode Types

Barcode Type Value
EAN-13 'ean-13'
EAN-8 'ean-8'
UPC-A 'upc-a'
UPC-E 'upc-e'
Code-39 'code-39'
Code-93 'code-93'
Code-2of5 'code-2of5'
Codabar 'codabar'
Code-128 'code-128'
MSI 'msi'
Pharmacode 'pharmacode'

Options

  • useAdaptiveThreshold: Apply adaptive thresholding for images with shading or gradients
  • singlePass: Use single-pass decoding for faster processing
  • detectRotation: Automatically detect and correct barcode rotation
  • locateBarcode: Automatically locate barcode region in image

Note

  • For best results, ensure barcode is relatively straight in the image
  • Works best when barcode occupies most of the image

Contributing

  • Each decoder is defined in src directory as a module.
  • Tests are defined in the test directory using Jest.

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptbarcodehacktoberfestjavascriptnode

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言