Barcode Generator

Generate various types of barcodes for your products and inventory

Customization Options
Current: 2
Current: 100px
Current: 14px
Current: 10px
Batch Generation
Advertisement
Barcode Types
  • Code 128: Most versatile, alphanumeric
  • EAN-13: European retail standard
  • UPC-A: US retail standard
  • Code 39: Industrial applications
  • ITF-14: Shipping containers
  • MSI: Inventory management
Common Uses
  • Product labeling
  • Inventory tracking
  • Asset management
  • Document tracking
  • Event tickets
  • Library books
Tips
  • Test scan before printing
  • Use high contrast colors
  • Ensure adequate margins
  • Print at recommended size
${svg} `); printWindow.document.close(); printWindow.print(); } function generateBatch() { const prefix = document.getElementById('batchPrefix').value; const start = parseInt(document.getElementById('batchStart').value); const count = parseInt(document.getElementById('batchCount').value); const type = document.getElementById('barcodeType').value; if (count > 50) { showNotification('Maximum 50 barcodes per batch', 'warning'); return; } batchBarcodes = []; const container = document.getElementById('batchContainer'); container.innerHTML = ''; for (let i = 0; i < count; i++) { const number = start + i; const text = prefix + number.toString().padStart(6, '0'); const col = document.createElement('div'); col.className = 'col-md-6 col-lg-4 mb-3'; const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); svg.id = `batch-barcode-${i}`; col.innerHTML = `
${text}
`; container.appendChild(col); col.querySelector('.barcode-container').appendChild(svg); try { JsBarcode(svg, text, { format: type, width: 1.5, height: 60, fontSize: 10, margin: 5, displayValue: true }); batchBarcodes.push({ text, svg: svg.outerHTML }); } catch (error) { console.error('Error generating batch barcode:', error); } } document.getElementById('batchResults').style.display = 'block'; showNotification(`Generated ${count} barcodes successfully!`, 'success'); } function downloadBatch() { // This would require a ZIP library like JSZip // For now, we'll show a message showNotification('Batch download feature requires additional library. Download individual barcodes for now.', 'info'); } function showNotification(message, type) { const notification = document.createElement('div'); notification.className = `alert alert-${type === 'error' ? 'danger' : type === 'warning' ? 'warning' : type === 'info' ? 'info' : 'success'} alert-dismissible fade show position-fixed`; notification.style.cssText = 'top: 20px; right: 20px; z-index: 9999; min-width: 300px;'; notification.innerHTML = ` ${message} `; document.body.appendChild(notification); setTimeout(() => { if (notification.parentNode) { notification.remove(); } }, 3000); }