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.
Function
Section titled “Function”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.
Configuration
Section titled “Configuration”| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| value | Text | Yes | — | Value to encode. Supports {{field}} and dot-notation. |
| format | Select | Yes | code128 | Barcode format. See formats table below. |
| outputMode | Select | No | dataurl | What goes in data.barcode: Data URL or pure base64. |
| scale | Number | No | 3 | Resolution multiplier (1–10). 6 = high resolution for printing. |
| height | Number | No | 15 | Bar height in bwip units (5–100). 1D barcodes only. |
| includeText | Select | No | true | Show human-readable text below the barcode (1D only). |
| qrErrorCorrection | Select | No | M | QR error correction level: L, M, Q, H. |
| fgColor | Text | No | 000000 | Bar color as 6-digit hex without #. |
| bgColor | Text | No | ffffff | Background color as 6-digit hex without #. |
Supported Formats
Section titled “Supported Formats”| Value | Name | Dimension | Main use case |
|---|---|---|---|
qrcode | QR Code | 2D | URLs, long text, mobile apps |
code128 | Code 128 | 1D | Logistics, warehouses (most common) |
code39 | Code 39 | 1D | Automotive, defense, alphanumeric |
ean13 | EAN-13 | 1D | Retail, 13 digits |
ean8 | EAN-8 | 1D | Compact retail, 8 digits |
upca | UPC-A | 1D | US retail, 12 digits |
itf | ITF / Interleaved 2 of 5 | 1D | Logistics, digit pairs |
pdf417 | PDF417 | 2D | Documents, passports |
datamatrix | Data Matrix | 2D | Industrial, electronic components |
aztec | Aztec Code | 2D | Train and plane tickets |
codabar | Codabar | 1D | Libraries, blood banks |
code93 | Code 93 | 1D | Canada Post |
Output
Section titled “Output”{ "barcode": "data:image/png;base64,iVBOR...", "base64": "iVBOR...", "dataUrl": "data:image/png;base64,iVBOR...", "format": "code128", "text": "1234567890"}| Field | Description |
|---|---|
barcode | Value based on outputMode (Data URL or pure base64) |
base64 | Always available: pure base64 without prefix |
dataUrl | Always available: data:image/png;base64,... |
format | Format used |
text | Encoded value (already resolved if it was a variable) |
Usage Examples
Section titled “Usage Examples”QR Code for order URL
Section titled “QR Code for order URL”{ "type": "barcodeGenerator", "config": { "label": "Order QR", "value": "https://mystore.com/orders/{{order_id}}", "format": "qrcode", "scale": 4, "qrErrorCorrection": "M", "outputMode": "dataurl", "nextModule": "generate_html" }}Code 128 for serial number
Section titled “Code 128 for serial number”{ "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" }}EAN-13 for retail product label
Section titled “EAN-13 for retail product label”{ "type": "barcodeGenerator", "config": { "label": "Product EAN-13", "value": "{{product.ean}}", "format": "ean13", "scale": 3, "height": 15, "includeText": "true", "outputMode": "dataurl", "nextModule": "attach_email" }}Embedding in an HTML template
Section titled “Embedding in an HTML template”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).
QR Error Correction
Section titled “QR Error Correction”| Level | Capacity | When to use |
|---|---|---|
L | 7% | On-screen QRs with no risk of damage |
M | 15% | General purpose (recommended) |
Q | 25% | Labels that may get dirty |
H | 30% | 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.
includeTexthas no effect on 2D formats (QR, PDF417, DataMatrix, Aztec) — by design, these do not include human-readable text.heightonly applies to 1D barcodes; it is ignored for 2D formats.- For high print resolution use
scale: 6or higher.scale: 3is sufficient for screen display. fgColorandbgColormust 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.
Related Nodes
Section titled “Related Nodes”- htmlTemplate — embeds
data.barcodein 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.base64into a downloadable PNG file