Templates
QR Codes & Barcodes New
Add QR codes and barcodes to your documents automatically using your HubSpot property values. Perfect for creating scannable documents like invoices, product labels, event tickets, and shipping labels.
QR Code Placeholders
QR codes encode information that can be scanned with a smartphone camera. Use them for:
- Website URLs
- Contact information
- Email addresses
- Phone numbers
- Profile links
How to Add a QR Code
Type a QR code placeholder in your Word template using this format:
{{qr:property_name}}
Replace property_name with your HubSpot property name. When the document is generated, the placeholder will be replaced with a QR code image.
Custom QR Code Size
You can control the size of your QR code by adding the size modifier:
{{qr:property_name | size:200}}
The size is specified in pixels. The default size is 150 pixels. You can use values between 50 and 500 pixels.
Examples
| Placeholder | Result |
|---|---|
{{qr:website}} |
QR code (default size: 150px) |
{{qr:website | size:200}} |
Larger QR code (200px) |
{{qr:website | size:100}} |
Smaller QR code (100px) |
{{qr:hs_object_link}} |
QR code linking to the HubSpot record |
{{qr:email}} |
QR code for email address |
{{qr:calendly_link}} |
QR code for booking link |
What Happens if the Property is Empty?
If the property has no value, the QR code placeholder is simply removed from the document. No broken image or error message will appear.
Barcode Placeholders
Barcodes are commonly used for:
- Product SKUs
- Serial numbers
- Invoice numbers
- Tracking codes
How to Add a Barcode
Type a barcode placeholder in your Word template:
{{barcode:property_name}}
By default, this creates a Code 128 barcode, which works with any text or numbers.
Barcode Formats
You can specify a different barcode format using the format modifier:
{{barcode:property_name | format:ean13}}
Or use the shorter colon syntax:
{{barcode:property_name:ean13}}
Available Formats
| Format | Placeholder Example | Best For |
|---|---|---|
| Code 128 | {{barcode:sku}} or {{barcode:sku | format:code128}} |
General purpose (letters and numbers) |
| EAN-13 | {{barcode:product_code | format:ean13}} |
European retail products (12-13 digits) |
| UPC-A | {{barcode:upc_code | format:upca}} |
US/Canadian retail products (11-12 digits) |
| Code 39 | {{barcode:serial | format:code39}} |
Industrial, healthcare (letters, numbers, and some symbols) |
Custom Barcode Size
You can control the size of your barcode using the size modifier:
{{barcode:property_name | size:80}}
For more control, specify both width and height:
{{barcode:property_name | size:200x60}}
The height is specified in pixels. The default height is 50 pixels. You can use values between 20 and 200 pixels.
Combining Format and Size
You can combine multiple modifiers using pipes:
{{barcode:product_code | format:ean13 | size:200x80}}
This creates an EAN-13 barcode with custom dimensions (200px wide, 80px tall).
Format Details
Code 128 (default)
- Accepts any text, numbers, and most special characters
- Most versatile format
- Example:
PROD-2024-XYZ,INV-00123
EAN-13
- Requires 12 or 13 digits
- Shorter numbers are padded with leading zeros
- Example:
5901234123457
UPC-A
- Requires 11 or 12 digits
- Shorter numbers are padded with leading zeros
- Example:
012345678905
Code 39
- Supports A-Z, 0-9, and: - . $ / + % SPACE
- Lowercase letters are converted to uppercase
- Example:
ABC-123
What Happens with Invalid Content?
If your property value doesn't match the barcode format requirements (for example, letters in an EAN-13 barcode), the system automatically falls back to Code 128 format, which accepts any content.
If the property is empty, the barcode placeholder is simply removed from the document.
Tips for Best Results
-
Size your placeholders - QR codes and barcodes are inserted at a fixed size. Leave enough space in your template.
-
Test with sample data - Before using in production, generate a test document to make sure the codes scan properly.
-
Use descriptive labels - Add text near your codes to indicate what information they contain.
-
Check barcode compatibility - Make sure the barcode format you choose works with your scanning equipment.
-
Avoid long URLs - Very long URLs create dense QR codes that may be harder to scan. Consider using a URL shortener for complex links.
Common Use Cases
Invoice with QR Payment Link
Invoice #: {{invoice_number}}
Amount: {{amount}}
Scan to pay: {{qr:payment_link}}
Product Label with SKU Barcode
Product: {{product_name}}
SKU: {{sku}}
{{barcode:sku}}
Event Ticket with Check-in Code
Event: {{event_name}}
Date: {{event_date}}
Attendee: {{firstname}} {{lastname}}
{{qr:ticket_code}}
Shipping Label with Tracking
Ship To: {{shipping_address}}
Tracking: {{tracking_number}}
{{barcode:tracking_number}}
Frequently Asked Questions
Q: What size are the generated QR codes and barcodes?
A: By default, QR codes are generated at 150x150 pixels (approximately 75x75 points, about 1 inch square). Barcodes have a default height of 50 pixels. You can customize both sizes using the size modifier.
Q: Can I scan the QR codes with my phone? A: Yes! QR codes are standard format and can be scanned with any smartphone camera or QR code reader app.
Q: Do barcodes work with standard barcode scanners? A: Yes, all barcode formats are industry standard and work with typical barcode scanning equipment.
Q: Can I use both placeholder syntaxes?
A: Yes, both {{qr:property}} and ${qr:property} work. You can also use a dot instead of colon: {{qr.property}}.
Q: What if my barcode scanner can't read the barcode? A: Make sure you're using the correct barcode format for your scanner. Code 128 is the most universally supported format. Also, ensure the printed document has good quality and sufficient size.
Q: Can I combine multiple modifiers?
A: Yes! Use pipes to chain modifiers together: {{barcode:sku | format:ean13 | size:200x80}}
Q: Are QR codes/barcodes supported in HTML templates?
A: Yes. QR and barcode placeholders are fully supported in Word, Google Docs, and HTML templates. The same {{qr:property}} and {{barcode:property}} syntax works in HTML templates and is automatically converted to inline images during document generation.