DEVELOPER REFERENCE

Barcode Decoder Documentation

Parameter-by-parameter guide for the original server-side CGI reader. Upload a barcode image, choose recognition settings, and receive plain text, an annotated image, or XML.

POST · multipart/form-data25 barcode flags5 decoding groups
GETTING STARTED

How the CGI reader works

Send an image file and optional parameters to the existing barcode CGI endpoint. The server performs decoding and responds in the output format selected with sr.

CGI ENDPOINThttps://online-barcode-reader.com/cgi-bin/brcgi
Open reference ↗
⇧Upload file

fupload1 via a multipart POST request

⚙Set options

Select types, quantity, speed and recognition modes

▣Receive result

sr=0 text · sr=1 image · sr=2 XML

This website uses the original CGI directly. No PHP frontend, API key, BarcodeDetector or ZXing is involved. The server-side CGI program itself must already be installed and working.

PARAMETER GROUP

General parameters

Form, output and image processing

↑ Top
ParameterDescriptionValuesDefault
fupload1Image file uploaded for decoding.JPG, GIF, PNG, BMP, TIFF (including multipage)Choose an image
srOutput format returned by the decoder.0 = Text; 1 = Image; 2 = XML1 (Image) *
types32-bit bitmask of barcode symbologies to search.See the complete bitmask reference below.922748607 *
widthMaximum width of the generated result image when sr = 1.Positive integer, pixels750 *
heightMaximum height of the generated result image when sr = 1.Positive integer, pixels510 *
frameTimeMaximum processing time for a frame.Milliseconds; 0 = unlimited0 **
inverseFind positive, negative, or both image polarities.1 = Positive; 2 = Negative; 3 = Both1 **
pOptional server password for non-demo operation.Only when required by a particular CGI installation.Not used here
MAX_FILE_SIZEUpload-size hint included in the original form.2097152 bytes = 2 MiB2097152 *

* Values used by the original online-barcode-reader.com form. The CGI reference lists its own defaults: sr = Text, width = 800, height = 600, and inverse = Positive.  ** CGI default; the original form does not explicitly submit this parameter.

PARAMETER GROUP

Linear (1D) barcodes

Additional options for linear symbols

↑ Top
ParameterDescriptionValuesDefault
lnumMaximum number of linear barcodes to find.Number1
lspeedLinear decoding mode.0 = Normal; 1 = Fast; 2 = Slow0
lshowidInclude the barcode symbology identifier.0 = Off; 1 = On0
lverifycheckVerify an additional check digit.0 = Off; 1 = On0
lshowcheckInclude the check digit in decoded text.0 = Off; 1 = On0 (current site)
lshowststInclude start/stop characters.0 = Off; 1 = On0
lcode39extEnable extended Code 39.0 = Off; 1 = On0 **
lupceupcaConvert UPC-E to UPC-A.0 = Off; 1 = On0 **
lverifyVerify a linear barcode by repeated scanning.0 = Off; 1 = On0 **
PARAMETER GROUP

QR Code

QR Code and Micro QR settings

↑ Top
ParameterDescriptionValuesDefault
qrnumMaximum QR codes to find.Number1
qrspeedQR decoding mode.0 = Normal; 1 = Fast; 2 = Slow0
qrsymidInclude the QR symbology identifier.0 = Off; 1 = On0 **
qrmicroEnable detection of Micro QR codes.0 = Off; 1 = On0 **
PARAMETER GROUP

Data Matrix

Data Matrix decoding settings

↑ Top
ParameterDescriptionValuesDefault
dmnumMaximum Data Matrix symbols to find.Number1
dmspeedData Matrix decoding mode.0 = Normal; 1 = Fast; 2 = Slow0
dmsymidInclude the Data Matrix symbology identifier.0 = Off; 1 = On0 **
dmsupporteciEnable Data Matrix ECI support.0 = Off; 1 = On0 **
dminverseSearch positive and/or inverted Data Matrix symbols.Controls polarity; see CGI reference.3 *
PARAMETER GROUP

PDF417

PDF417 and Micro PDF417 settings

↑ Top
ParameterDescriptionValuesDefault
pdf417numMaximum PDF417 barcodes to find.Number1
pdf417speedPDF417 decoding mode.0 = Normal; 1 = Fast; 2 = Slow0
pdf417symidInclude the PDF417 symbology identifier.0 = Off; 1 = On0 **
pdf417microEnable Micro PDF417 detection.0 = Off; 1 = On0 **
pdf417supporteciEnable PDF417 ECI support.0 = Off; 1 = On0 **
pdf417robustEnable robust decoding for highly distorted PDF417.0 = Off; 1 = On0 **
PARAMETER GROUP

Aztec Code

Aztec decoding settings

↑ Top
ParameterDescriptionValuesDefault
aznumMaximum Aztec codes to find.Number1
azspeedAztec decoding mode.0 = Normal; 1 = Fast; 2 = Slow0
azsymidInclude the Aztec symbology identifier.0 = Off; 1 = On0 **
BARCODE TYPES

types bitmask reference

Exact symbology flags used by the original page's UpdateBarcodeType() function.

↑ Top
i
The types value is the bitwise OR of selected symbologies. JavaScript uses signed 32-bit bitwise operations; enabling Aztec may produce a negative decimal value. The CGI receives that signed decimal string — do not convert it to an unsigned number.
Barcode type / modeOriginal checkboxHex flagSigned decimal flag
Code 128c10x000000011
Code 39c20x000000022
Interleaved 2/5c40x000000044
EAN-13c80x000000088
EAN-8c90x0000001016
Codabarc30x0000002032
Code 11c70x0000004064
UPC-Ac100x00000080128
UPC-Ec110x00000100256
Industrial 2/5c50x00000200512
Code 93c60x000004001024
DataBar RSS-14c160x000008002048
DataBar Limitedc170x000010004096
DataBar Stackedc180x000020008192
DataBar Expandedc190x0000400016384
DataBar Expanded Stackedc200x0000800032768
Aztec Unrecognizedc240x001000001048576
Linear Unrecognizedc130x0100000016777216
PDF417 Unrecognizedc140x0200000033554432
Data Matrix Unrecognizedc250x0400000067108864
QR Code Unrecognizedc220x08000000134217728
Data Matrixc150x10000000268435456
PDF417c120x20000000536870912
QR Codec210x400000001073741824
Aztec Codec230x80000000-2147483648
QR Code + Data Matrixtypes=1342177280
Aztec Code onlytypes=-2147483648
INTEGRATION EXAMPLE

Sending an image from HTML

A standard HTML form is enough. The browser handles the multipart file upload; no custom JavaScript or proxy is needed.

↑ Top
HTML · multipart POSTDirect CGI call
<form action="https://online-barcode-reader.com/cgi-bin/brcgi"
      method="post" enctype="multipart/form-data">
  <input type="file" name="fupload1" required>
  <input type="hidden" name="types" value="1342177280">
  <input type="hidden" name="qrnum" value="1">
  <input type="hidden" name="dmnum" value="1">
  <select name="sr">
    <option value="0">Text</option>
    <option value="1">Image</option>
    <option value="2">XML</option>
  </select>
  <button type="submit">Decode image</button>
</form>
i
Example bitmask 1342177280 enables QR Code and Data Matrix. The actual site submits all its original decoding fields. The CGI returns the response body directly, so a same-origin iframe can show its text, XML or image result.
ADDITIONAL INFORMATION

Formats, defaults & sources

↑ Top

Accepted images

The original upload form lists JPG, GIF, PNG, BMP and TIFF, including multipage TIFF. Its frontend limit is 2 MiB.

Defaults

A star (*) in the tables marks values explicitly submitted by the online-barcode-reader.com form. The current redesigned form uses lshowcheck=0 by default (the older source used 1). Double stars (**) indicate CGI documentation defaults for parameters not explicitly submitted by that form.

Return formats

In Text or XML mode the CGI returns corresponding data; in Image mode it returns a depiction of the decoded barcode(s). The response format is controlled by sr.

Advanced settings

Some parameters listed here are available to the CGI but are not currently exposed as controls on the site's main page. They can be included in custom multipart requests.

Reference: DataSymbol BarcodeReader CGI parameter list ↗ and the original Online Barcode Reader form. The type bitmask flags were transcribed from the original page's UpdateBarcodeType() function.

Ready to decode a barcode?

Return to the reader and upload an image using these settings.

Open online decoder →