Skip to content

Barcode Generator

This node converts text or a number into a barcode or QR code image. It returns the image as pure base64 and as a Data URL ready to use in <img src>, HTML templates, emails, or PDF files. Supports more than 12 industry-standard formats.

Uses the bwip-js library to render the code as a PNG. The value to encode can be a fixed string or a dynamic payload variable ({{field}}). The result never overwrites the input payload: it always returns an object with the barcode, base64, and dataUrl properties alongside the original data.

FieldTypeRequiredDefaultDescription
valueTextYes—Value to encode. Supports {{field}} and dot-notation.
formatSelectYescode128Barcode format. See formats table below.
outputModeSelectNodataurlWhat goes in data.barcode: Data URL or pure base64.
scaleNumberNo3Resolution multiplier (1–10). 6 = high resolution for printing.
heightNumberNo15Bar height in bwip units (5–100). 1D barcodes only.
includeTextSelectNotrueShow human-readable text below the barcode (1D only).
qrErrorCorrectionSelectNoMQR error correction level: L, M, Q, H.
fgColorTextNo000000Bar color as 6-digit hex without #.
bgColorTextNoffffffBackground color as 6-digit hex without #.
ValueNameDimensionMain use case
qrcodeQR Code2DURLs, long text, mobile apps
code128Code 1281DLogistics, warehouses (most common)
code39Code 391DAutomotive, defense, alphanumeric
ean13EAN-131DRetail, 13 digits
ean8EAN-81DCompact retail, 8 digits
upcaUPC-A1DUS retail, 12 digits
itfITF / Interleaved 2 of 51DLogistics, digit pairs
pdf417PDF4172DDocuments, passports
datamatrixData Matrix2DIndustrial, electronic components
aztecAztec Code2DTrain and plane tickets
codabarCodabar1DLibraries, blood banks
code93Code 931DCanada Post
{
"barcode": "data:image/png;base64,iVBOR...",
"base64": "iVBOR...",
"dataUrl": "data:image/png;base64,iVBOR...",
"format": "code128",
"text": "1234567890"
}
FieldDescription
barcodeValue based on outputMode (Data URL or pure base64)
base64Always available: pure base64 without prefix
dataUrlAlways available: data:image/png;base64,...
formatFormat used
textEncoded value (already resolved if it was a variable)
{
"type": "barcodeGenerator",
"config": {
"label": "Order QR",
"value": "https://mystore.com/orders/{{order_id}}",
"format": "qrcode",
"scale": 4,
"qrErrorCorrection": "M",
"outputMode": "dataurl",
"nextModule": "generate_html"
}
}
{
"type": "barcodeGenerator",
"config": {
"label": "Serial barcode",
"value": "{{serial_number}}",
"format": "code128",
"scale": 3,
"height": 20,
"includeText": "true",
"fgColor": "000000",
"bgColor": "ffffff",
"outputMode": "dataurl",
"nextModule": "print_label"
}
}
{
"type": "barcodeGenerator",
"config": {
"label": "Product EAN-13",
"value": "{{product.ean}}",
"format": "ean13",
"scale": 3,
"height": 15,
"includeText": "true",
"outputMode": "dataurl",
"nextModule": "attach_email"
}
}

Combining with the HTML Template node, you can embed the QR directly:

<img src="{{barcode}}" alt="Order QR" width="200" height="200" />

The flow would be: barcodeGenerator → htmlTemplate (using {{barcode}} as a variable).

LevelCapacityWhen to use
L7%On-screen QRs with no risk of damage
M15%General purpose (recommended)
Q25%Labels that may get dirty
H30%QRs with overlaid logos or in harsh environments
  • EAN-13: requires exactly 13 digits; EAN-8 requires 8; UPC-A requires 12. An incorrect length causes an error.
  • ITF: requires an even number of digits.
  • includeText has no effect on 2D formats (QR, PDF417, DataMatrix, Aztec) — by design, these do not include human-readable text.
  • height only applies to 1D barcodes; it is ignored for 2D formats.
  • For high print resolution use scale: 6 or higher. scale: 3 is sufficient for screen display.
  • fgColor and bgColor must be 6-digit hex without the # symbol (e.g. "1976d2").
  • The node never modifies the input payload; the generated image coexists with original data if a Merge node follows.
  • htmlTemplate — embeds data.barcode in an HTML template with <img src="{{barcode}}">
  • generatepdf — converts the HTML containing the barcode into a printable PDF
  • sendMail — attaches or embeds the code in the email body
  • base64tofile — converts data.base64 into a downloadable PNG file