Barcode Generator

Generate Code 128, Code 39, EAN-13, EAN-8, and UPC-A barcodes. Download as PNG or SVG.

Single Barcode

Show text below barcode

Bulk Generation

Enter one value per line. Uses the format selected above.

Check Digit Calculator

Want more tools?

All 269 tools on this site are completely free — no account, no subscription. Everything runs locally in your browser.

Related Tools

CSS Box Shadow Generator · Emoji Picker & Search · Meta Tag Generator · Free Color Palette Generator · Favicon Generator

Related Tools

Free Icon Generator · Free Git Diff Viewer · Hash Generator

Related Tools

Free Color Palette Generator · Free CSS Gradient Generator · Free JSON to YAML Converter

Related Tools

Free JSON to YAML Converter · Free CSS Gradient Generator · YAML to JSON Converter

`); w.document.close(); } function bulkGenerate(){ const lines=document.getElementById('bulkData').value.split('\n').map(l=>l.trim()).filter(Boolean); if(!lines.length) return; const format=document.getElementById('barcodeFormat').value; const barW=parseInt(document.getElementById('barWidth').value)||2; const barH=parseInt(document.getElementById('barHeight').value)||80; const barColor=document.getElementById('barColor').value; const bgColor=document.getElementById('bgColor').value; const showText=document.getElementById('showText').checked; const container=document.getElementById('bulkResults'); container.innerHTML=''; lines.forEach(val=>{ let bits=null,displayText=val; if(format==='code128') bits=C128.encode(val); else if(format==='code39'){bits=C39.encode(val);displayText='*'+val.toUpperCase()+'*';} else if(format==='ean13'){let d=val.replace(/\D/g,'');if(d.length===12)d+=EAN.checkDigit(d);if(d.length===13)bits=EAN.encodeEAN13(d);displayText=d;} else if(format==='ean8'){let d=val.replace(/\D/g,'');if(d.length===7)d+=EAN.checkDigitUPC(d);if(d.length===8)bits=EAN.encodeEAN8(d);displayText=d;} else if(format==='upca'){let d=val.replace(/\D/g,'');if(d.length===11)d+=EAN.checkDigitUPC(d);if(d.length===12)bits=EAN.encodeUPCA(d);displayText=d;} const item=document.createElement('div');item.className='bulk-item'; const canvas=document.createElement('canvas'); if(bits){renderBarcode(canvas,bits,displayText,barW,barH,barColor,bgColor,showText);} else{canvas.width=200;canvas.height=50;const ctx=canvas.getContext('2d');ctx.fillStyle='#f87171';ctx.font='12px sans-serif';ctx.fillText('Invalid: '+val,10,30);} item.appendChild(canvas); const p=document.createElement('p');p.textContent=val;item.appendChild(p); container.appendChild(item); }); } function calcCheckDigit(){ const format=document.getElementById('checkFormat').value; const input=document.getElementById('checkInput').value.replace(/\D/g,''); const result=document.getElementById('checkResult'); let expected,full; if(format==='ean13'){ if(input.length!==12){result.textContent='EAN-13 needs exactly 12 digits.';return;} const cd=EAN.checkDigit(input);full=input+cd; result.innerHTML=`Check digit: ${cd} — Full code: ${full}`; }else if(format==='ean8'){ if(input.length!==7){result.textContent='EAN-8 needs exactly 7 digits.';return;} const cd=EAN.checkDigitUPC(input);full=input+cd; result.innerHTML=`Check digit: ${cd} — Full code: ${full}`; }else{ if(input.length!==11){result.textContent='UPC-A needs exactly 11 digits.';return;} const cd=EAN.checkDigitUPC(input);full=input+cd; result.innerHTML=`Check digit: ${cd} — Full code: ${full}`; } } renderEmpty();