WOLFRAM

recognizes a barcode in image and returns it as a string.

BarcodeRecognize[image,"prop"]

returns the specified property of the barcode.

BarcodeRecognize[image,"prop",format]

recognizes barcodes of the specified format only.

BarcodeRecognize[video,]

recognizes barcodes in frames of video.

Details

  • BarcodeRecognize works with arbitrary grayscale and multichannel images, operating on the intensity value of each pixel.
  • If multiple barcodes exist in the image, a list of decoded barcodes is returned.
  • The following properties "prop" are supported:
  • "Data"recognized barcode data
    "Format"recognized format for the barcode
    "BoundingBox"approximate bounding box for the barcode as a Rectangle
    "Orientation"orientation used for recognizing the barcode
    {prop1,prop2,}a list of properties
  • To extract a list of available properties and their values use:
  • "Properties"the list of available properties
    "PropertyAssociation"an association of all properties and their values
  • With BarcodeRecognize[image,"prop",{format1,format2,}], a list of formats to include in barcode recognition can be specified.
  • BarcodeRecognize works with different types of one- and two-dimensional barcodes.
  • The following 1D barcode formats can be used for format:
  • "UPC"UPC-A12 numerical digits
    "UPCE"UPC-E8 numerical digits
    "EAN8"EAN-88 numerical digits
    "EAN13"EAN-1313 numerical digits
    "Code39"Code 39up to 43 characters of uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space
    "Code93"Code 93uppercase letters, numeric digits, special characters -, ., $, /, +, %, and space
    "Code128"Code 128up to 80 ASCII characters
    "ITF"ITFup to 80 numerical digits of an even length
    "Codabar"Codabarnumerical digits and special characters :, /, +, .
    "GS1"GS1 DataBar (or RSS)14 numerical digits
    "ExpandedGS1"GS1 Expanded and Expanded Stacked74 digits or 41 alphanumeric characters in a single row or up to 11 stacked rows (GS1 DataBar Expanded Stacked)
  • The following 2D barcode formats can be used for format:
  • "QR"QR variable-length ASCII characters
    "PDF417"PDF417variable-length ASCII characters
    "Aztec"Aztec codevariable-length ASCII characters
    "DataMatrix"Data Matrix codevariable-length ASCII characters
    "MaxiCode"MaxiCodeup to 93 ASCII characters
    "MicroQR"MicroQRvariable-length ASCII characters

Examples

open allclose all

Basic Examples  (2)Summary of the most common use cases

Recognize a UPC-A barcode:

Out[11]=11

Recognize a QR barcode:

Out[1]=1

Scope  (23)Survey of the scope of standard use cases

Data  (2)

Recognize barcode in an image:

Out[1]=1

Recognize barcodes in frames of a video:

Out[1]=1
Out[2]=2

Formats  (17)

Recognize a UPC barcode:

Out[1]=1

Recognize a UPC-E barcode:

Out[1]=1

Recognize an EAN-8 barcode:

Out[1]=1

Recognize an EAN-13 barcode:

Out[1]=1

Recognize a Code 39 barcode:

Out[1]=1

Recognize a Code 93 barcode:

Out[1]=1

Recognize a Code 128 barcode:

Out[1]=1

Recognize an ITF barcode:

Out[1]=1

Recognize a Codabar barcode:

Out[1]=1

Generate a GS1 barcode:

Out[1]=1

Recognize a GS1 (Expanded) barcode:

Out[1]=1

Recognize a QR barcode:

Out[1]=1

Recognize a MicroQR barcode:

Out[1]=1

Recognize a PDF417 barcode:

Out[1]=1

Recognize an Aztec barcode:

Out[1]=1

Recognize a Data Matrix barcode:

Out[1]=1

Recognize a MaxiCode barcode:

Out[1]=1

Properties  (4)

List all available properties:

Out[1]=1

Extract all properties for a QR code:

Out[2]=2

Return the decoded barcode:

Out[2]=2

Barcode format:

Out[3]=3

Compute and visualize the bounding box:

Out[4]=4
Out[5]=5

Recognize bounding box of multiple barcodes:

Out[2]=2

Highlight barcode bounding boxes:

Out[3]=3

Get the format with the error correction level:

Out[1]=1

Applications  (4)Sample problems that can be solved with this function

Read an ISBN from a scan of a book:

Out[1]=1

ISBN is an EAN-13 barcode:

Out[2]=2

Use Hyperlink to get a link from a QR code:

Out[1]=1

Decode a QR code:

Out[1]=1

Highlight the bounding box of the QR code:

Out[2]=2

Recognize and annotate a recognized barcode:

Out[1]=1
Out[2]=2

Properties & Relations  (4)Properties of the function, and connections to other functions

Recognize a noisy PDF417 code:

Out[1]=1

Recognize a damaged QR code:

Out[1]=1

Recognize a damaged UPC code:

Out[1]=1

Use BarcodeImage to generate a barcode image:

Out[1]=1
Out[2]=2

Possible Issues  (1)Common pitfalls and unexpected behavior

Book ISBNs typically have a price barcode that may be recognized with the main code:

Out[2]=2

Computed bounding box may not be accurate:

Out[3]=3

Neat Examples  (2)Surprising or curious use cases

Recognize and speak the text stored in a barcode:

Recognize and evaluate an expression:

Out[1]=1
Out[2]=2
Wolfram Research (2014), BarcodeRecognize, Wolfram Language function, https://reference.wolfram.com/language/ref/BarcodeRecognize.html (updated 2025).
Wolfram Research (2014), BarcodeRecognize, Wolfram Language function, https://reference.wolfram.com/language/ref/BarcodeRecognize.html (updated 2025).

Text

Wolfram Research (2014), BarcodeRecognize, Wolfram Language function, https://reference.wolfram.com/language/ref/BarcodeRecognize.html (updated 2025).

Wolfram Research (2014), BarcodeRecognize, Wolfram Language function, https://reference.wolfram.com/language/ref/BarcodeRecognize.html (updated 2025).

CMS

Wolfram Language. 2014. "BarcodeRecognize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/BarcodeRecognize.html.

Wolfram Language. 2014. "BarcodeRecognize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/BarcodeRecognize.html.

APA

Wolfram Language. (2014). BarcodeRecognize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BarcodeRecognize.html

Wolfram Language. (2014). BarcodeRecognize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BarcodeRecognize.html

BibTeX

@misc{reference.wolfram_2025_barcoderecognize, author="Wolfram Research", title="{BarcodeRecognize}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/BarcodeRecognize.html}", note=[Accessed: 23-May-2025 ]}

@misc{reference.wolfram_2025_barcoderecognize, author="Wolfram Research", title="{BarcodeRecognize}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/BarcodeRecognize.html}", note=[Accessed: 23-May-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_barcoderecognize, organization={Wolfram Research}, title={BarcodeRecognize}, year={2025}, url={https://reference.wolfram.com/language/ref/BarcodeRecognize.html}, note=[Accessed: 23-May-2025 ]}

@online{reference.wolfram_2025_barcoderecognize, organization={Wolfram Research}, title={BarcodeRecognize}, year={2025}, url={https://reference.wolfram.com/language/ref/BarcodeRecognize.html}, note=[Accessed: 23-May-2025 ]}