feat: Add a new barcode generator tool with client-side functionality, supporting components, and a Google Indexing script.

This commit is contained in:
Timo Knuth 2026-01-21 13:43:46 +01:00
parent 373e19a515
commit c1471830f3
8 changed files with 1216 additions and 152 deletions

724
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -36,12 +36,14 @@
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"chart.js": "^4.4.0", "chart.js": "^4.4.0",
"clsx": "^2.0.0", "clsx": "^2.0.0",
"copy-image-clipboard": "^2.1.2",
"d3-scale": "^4.0.2", "d3-scale": "^4.0.2",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"dotenv": "^17.2.3", "dotenv": "^17.2.3",
"exceljs": "^4.4.0", "exceljs": "^4.4.0",
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"framer-motion": "^12.24.10", "framer-motion": "^12.24.10",
"googleapis": "^170.1.0",
"html-to-image": "^1.11.13", "html-to-image": "^1.11.13",
"i18next": "^23.7.6", "i18next": "^23.7.6",
"ioredis": "^5.3.2", "ioredis": "^5.3.2",
@ -51,7 +53,7 @@
"next": "^14.2.35", "next": "^14.2.35",
"next-auth": "^4.24.5", "next-auth": "^4.24.5",
"papaparse": "^5.4.1", "papaparse": "^5.4.1",
"posthog-js": "^1.276.0", "posthog-js": "^1.332.0",
"qr-code-styling": "^1.9.2", "qr-code-styling": "^1.9.2",
"qrcode": "^1.5.3", "qrcode": "^1.5.3",
"qrcode.react": "^3.1.0", "qrcode.react": "^3.1.0",

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

View File

@ -0,0 +1,66 @@
const { google } = require('googleapis');
const fs = require('fs');
const path = require('path');
// KONFIGURATION
// ==========================================
// Pfad zu deinem Service Account Key
const KEY_FILE = path.join(__dirname, '../service_account.json');
// Liste der URLs, die du indexieren willst
const URLS_TO_INDEX = [
'https://www.qrmaster.net/tools/barcode-generator',
// Füge hier weitere URLs hinzu
];
// ==========================================
async function runUsingServiceAccount() {
if (!fs.existsSync(KEY_FILE)) {
console.error('❌ FEHLER: service_account.json nicht gefunden!');
console.error(' Bitte befolge die Anleitung in INDEXING_GUIDE.md und speichere den Key im Hauptordner.');
return;
}
console.log(`🔑 Authentifiziere mit Key-File: ${KEY_FILE}...`);
const auth = new google.auth.GoogleAuth({
keyFile: KEY_FILE,
scopes: ['https://www.googleapis.com/auth/indexing'],
});
const client = await auth.getClient();
// console.log(`🔑 Authentifiziere als: ${key.client_email}...`);
try {
// await jwtClient.authorize(); // Nicht mehr nötig mit GoogleAuth
console.log('✅ Authentifizierung erfolgreich.');
for (const url of URLS_TO_INDEX) {
console.log(`🚀 Sende Indexierungs-Anfrage für: ${url}`);
const result = await google.indexing('v3').urlNotifications.publish({
auth: client,
requestBody: {
url: url,
type: 'URL_UPDATED'
}
});
console.log(` Status: ${result.status} ${result.statusText}`);
console.log(` Server Antwort:`, result.data);
}
console.log('\n✨ Fertig! Google wurde benachrichtigt.');
console.log(' Hinweis: Es kann immer noch ein paar Stunden dauern, bis Änderungen sichtbar sind.');
} catch (error) {
console.error('\n❌ Es ist ein Fehler aufgetreten:');
console.error(error.message);
if (error.response) {
console.error('Details:', error.response.data);
}
}
}
runUsingServiceAccount();

13
service_account.json Normal file
View File

@ -0,0 +1,13 @@
{
"type": "service_account",
"project_id": "gen-lang-client-0595806638",
"private_key_id": "e44bc1717f1cf413521149de272bf13bfa89a336",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC0xJkozHODpcpD\nu3dTHPfprZk6eKiOT05h+uG8Clm8i8LLaS/eHT+B02qxFYMBX0VH9O2GvPp/VnfC\nB/Clc7bofN5VDpQMjVUiPDqMbUVEAiQHNOTp9pkfJltaHAl/J5Cc/DccCaOn89xT\nFD5b7dTn29suuBZHTqsaFDlydnU2xJAwcrWBm7/A0JZM85d76yhY0Jxcg9w8XlpE\n+TWN8OxSUIfubaac0mfI40RH2EfugmA7M45t7B3sEbmHk5tVQSItvncz2ls9fUE4\neB6u4foMFp4Z9k5Ejs7y4N3Yft0JWS+RjI0bcvvvQ/wcnDfcwCdDFFn2Y+hflKMm\nS9+ZRnmBAgMBAAECggEAAztAeo3JifZD3nzEUcDte9cHgN7AMtlJ3Wvc7va5Sw50\nizkCmSlwPoc4/0MvoMo0+701JVxbenXveMpEb3fZMoszkdU9U9iPZCfzB4wQErOa\nppuprbbOXtO9JzZVinWzflPSIUVK16lUVvYVrmfpHYou1G/dIMIXQkVsD7NR9t/B\nafD0w/q1nwwyPB08BjSemKXDQo6NF0cE/TIvaMj8vtxuouAL+fea0n/XxMQNoIoJ\nF+pJtPQ1hkQrpayzuj3smQ11PFpYuvsZHuS3dG9j4gPjGClezK3Sflt7vwNywIRc\ntJ0Qx58on0dy0YnppMWrHh/nykraVLusvMI04joqwQKBgQDlE1Mbi8dpeKn7zkV9\nLS/O6S5Ql2k2G6KxI8GHn3qxB5yfU8G2xqk64r04YB6SMCXscIQu1Tmro8kDMTZk\n5b/issH3+7uqGcJMYhZczWsjax3S1ugepXt29dF26VnbyfvD7h9qleKLhIq32z9P\nxzZGhptTCa0swypi7prNE0MhZwKBgQDKA75g8UhVULA6q3hFEG+24ICd3Gekdz1y\nmaDrPjSJmeMSUlDl4QhGRbZBSJcAfcFKk4+Nme3sTYvjMMz6per4a5TC/+IlSufm\nOSL+CSVijvVYwCMyLyiAcm5Pqcjw16S6enHIidnOYP8e8OM0H2aNKfFTKq30B3ww\nAF8ipa+01wKBgQC24JaYhx7LtOj/fc08AbcJGF9BN59m8ukPQdxeyZLJgaooCFW9\n9RtlR16IgzPkwUuFVs4wFUnVHQx83+zs3/4wnUT9FJrdUXMsR6JStCu0Ou+0Qp1M\n2g+XCOgQZnq2XKoB4ThzfvU9LLMR1JbWudM6unuF71OxSJ2uHY636YjOQQKBgBs6\n+fSTUY6+e6LM7j9RAd4C0RN2XDodIJlMABb1oZtStPsJQYJbHQRr7S9Lm58jVGS7\nE0ShFSMfKNYNA/RdXRjzV3AZkeA5Ap1T4lWf4fwxDP1TmOrw1GLMCfaPClj8mGXS\nj3farRNWm80N53JlMSuiFbeCL0SPpbvKsQg4kUCtAoGAUORyhW70nhZJ1BbmvyRf\n17fcwenK/3GmWgqsrzN7/ucPwjqIzLGVoAXd2euxpE49/VW2xYpJjyHJHuoXDc66\n+AUog0bsxcKpM5tL3VelQl3SkUlCG7jYe20rMm01y35uM2REvQv3/r9F7Bbaq/9n\nSCwu/45QobgLCUx0B7wDqWA=\n-----END PRIVATE KEY-----\n",
"client_email": "indexer@gen-lang-client-0595806638.iam.gserviceaccount.com",
"client_id": "111279247752160222047",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/indexer%40gen-lang-client-0595806638.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}

View File

@ -3,13 +3,13 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import Barcode from 'react-barcode'; import Barcode from 'react-barcode';
import Link from 'next/link'; import Link from 'next/link';
import { Download, Printer, Barcode as BarcodeIcon, Sparkles, Sliders, Check, Info } from 'lucide-react'; import { Download, Printer, Barcode as BarcodeIcon, Sparkles, Sliders, Check, Info, Copy } from 'lucide-react';
import { Button } from '@/components/ui/Button'; import { Button } from '@/components/ui/Button';
import { Input } from '@/components/ui/Input'; import { Input } from '@/components/ui/Input';
import { Select } from '@/components/ui/Select'; import { Select } from '@/components/ui/Select';
import { showToast } from '@/components/ui/Toast'; import { showToast } from '@/components/ui/Toast';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
import { toPng, toSvg } from 'html-to-image'; import { toPng, toSvg, toBlob } from 'html-to-image';
// Brand Colors // Brand Colors
const BRAND = { const BRAND = {
@ -52,9 +52,26 @@ export default function BarcodeGeneratorClient() {
const [displayValue, setDisplayValue] = useState(true); const [displayValue, setDisplayValue] = useState(true);
const [lineColor, setLineColor] = useState('#000000'); const [lineColor, setLineColor] = useState('#000000');
const [frameType, setFrameType] = useState('none'); const [frameType, setFrameType] = useState('none');
const [error, setError] = useState<string | null>(null);
const barcodeRef = useRef<HTMLDivElement>(null); const barcodeRef = useRef<HTMLDivElement>(null);
// Validation Logic
React.useEffect(() => {
setError(null);
if (!value) return;
if (format === 'EAN13' && !/^\d{12,13}$/.test(value)) {
setError('EAN-13 requires 12 or 13 digits.');
} else if (format === 'UPC' && !/^\d{11,12}$/.test(value)) {
setError('UPC requires 11 or 12 digits.');
} else if (format === 'CODE39' && !/^[0-9A-Z\-\.\ \$\/\+\%]+$/.test(value)) {
setError('Code 39 only supports numbers, uppercase letters, and - . $ / + % spaces.');
} else if ((format === 'ITF14' || format === 'MSI') && !/^\d+$/.test(value)) {
setError('This format only supports numbers.');
}
}, [value, format]);
const downloadBarcode = async (extension: 'png' | 'svg') => { const downloadBarcode = async (extension: 'png' | 'svg') => {
if (!barcodeRef.current) return; if (!barcodeRef.current) return;
@ -85,6 +102,31 @@ export default function BarcodeGeneratorClient() {
} }
}; };
const copyBarcode = async () => {
if (!barcodeRef.current) return;
try {
// Use toBlob directly for better performance and compatibility
const blob = await toBlob(barcodeRef.current, {
backgroundColor: '#ffffff',
pixelRatio: 3,
});
if (!blob) {
throw new Error('Failed to generate image blob');
}
await navigator.clipboard.write([
new ClipboardItem({
'image/png': blob,
}),
]);
showToast('Barcode copied to clipboard', 'success');
} catch (err) {
console.error('Copy failed', err);
showToast('Failed to copy barcode', 'error');
}
};
const formats = [ const formats = [
{ value: 'CODE128', label: 'Code 128 (Standard)' }, { value: 'CODE128', label: 'Code 128 (Standard)' },
{ value: 'EAN13', label: 'EAN-13 (Retail)' }, { value: 'EAN13', label: 'EAN-13 (Retail)' },
@ -265,7 +307,7 @@ export default function BarcodeGeneratorClient() {
</div> </div>
<div ref={barcodeRef} className="py-4 bg-white flex flex-col items-center justify-center overflow-hidden w-full"> <div ref={barcodeRef} className="py-4 bg-white flex flex-col items-center justify-center overflow-hidden w-full">
{frameType !== 'none' && ( {frameType !== 'none' && !error && (
<div <div
className="mb-4 px-6 py-2 rounded-full text-white font-bold text-xs tracking-widest uppercase shadow-md" className="mb-4 px-6 py-2 rounded-full text-white font-bold text-xs tracking-widest uppercase shadow-md"
style={{ backgroundColor: lineColor }} style={{ backgroundColor: lineColor }}
@ -273,7 +315,16 @@ export default function BarcodeGeneratorClient() {
{FRAME_OPTIONS.find(f => f.id === frameType)?.label} {FRAME_OPTIONS.find(f => f.id === frameType)?.label}
</div> </div>
)} )}
{value ? (
{error ? (
<div className="flex flex-col items-center text-center p-6 animate-in fade-in zoom-in duration-200">
<div className="w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mb-3">
<Info className="w-6 h-6 text-red-500" />
</div>
<p className="text-red-500 font-bold text-sm">{error}</p>
<p className="text-slate-400 text-xs mt-1">Please correct your input.</p>
</div>
) : value ? (
<Barcode <Barcode
key={`${format}-${lineColor}-${value}-${width}-${height}-${displayValue}`} key={`${format}-${lineColor}-${value}-${width}-${height}-${displayValue}`}
value={value} value={value}
@ -305,28 +356,51 @@ export default function BarcodeGeneratorClient() {
</div> </div>
{/* Download Buttons */} {/* Download Buttons */}
<div className="flex flex-col sm:flex-row items-center gap-3 mt-8 w-full max-w-[450px]"> <div className="flex flex-col gap-4 mt-8 w-full max-w-[450px]">
<Button <div className="flex flex-col sm:flex-row items-center gap-3 w-full">
onClick={() => downloadBarcode('png')} <Button
className="w-full sm:flex-1 bg-slate-900 hover:bg-black text-white shadow-lg h-12 rounded-xl" onClick={() => downloadBarcode('png')}
> className="w-full sm:flex-1 bg-slate-900 hover:bg-black text-white shadow-lg h-12 rounded-xl"
<Download className="w-4 h-4 mr-2" /> >
Download PNG <Download className="w-4 h-4 mr-2" />
</Button> Download PNG
<Button </Button>
onClick={() => downloadBarcode('svg')} <div className="relative w-full sm:w-auto">
variant="outline" <div className="absolute -top-3 left-1/2 -translate-x-1/2 bg-indigo-600 text-white text-[9px] font-bold px-2 py-0.5 rounded-full whitespace-nowrap shadow-sm z-10 pointer-events-none">
className="w-full sm:w-auto px-6 border-slate-300 hover:bg-white h-12 rounded-xl font-bold" BEST FOR PRINT
> </div>
SVG <Button
</Button> onClick={() => downloadBarcode('svg')}
<Button variant="outline"
onClick={() => window.print()} className="w-full sm:w-auto px-6 border-slate-300 hover:bg-white h-12 rounded-xl font-bold"
variant="outline" >
className="w-full sm:w-auto px-4 border-slate-300 hover:bg-white h-12 rounded-xl" SVG
> </Button>
<Printer className="w-4 h-4 text-slate-600" /> </div>
</Button> <Button
onClick={copyBarcode}
variant="outline"
className="w-full sm:w-auto px-4 border-slate-300 hover:bg-white h-12 rounded-xl"
title="Copy to Clipboard"
>
<Copy className="w-4 h-4 text-slate-600" />
</Button>
<Button
onClick={() => window.print()}
variant="outline"
className="w-full sm:w-auto px-4 border-slate-300 hover:bg-white h-12 rounded-xl"
title="Print"
>
<Printer className="w-4 h-4 text-slate-600" />
</Button>
</div>
<div className="text-center">
<Link href="/signup" className="text-xs font-medium text-slate-400 hover:text-indigo-600 transition-colors flex items-center justify-center gap-1 group">
Need bulk generation?
<span className="underline decoration-slate-300 group-hover:decoration-indigo-300 underline-offset-4">Available in Pro &rarr;</span>
</Link>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,319 @@
import { BookOpen, CheckCircle, HelpCircle, Layers, Settings, ShoppingCart, Tag, Activity, Factory } from 'lucide-react';
import Link from 'next/link';
export function BarcodeGuide() {
return (
<section className="py-16 px-4 sm:px-6 lg:px-8 bg-white" id="guide">
<div className="max-w-3xl mx-auto prose prose-slate prose-lg">
<div className="flex items-center gap-3 mb-8 not-prose">
<div className="p-3 bg-blue-100/50 rounded-xl">
<BookOpen className="w-8 h-8 text-blue-600" />
</div>
<h2 className="text-3xl font-bold text-slate-900 m-0">
Barcode Generator How Barcodes Work and Why They Matter
</h2>
</div>
<p className="lead text-xl text-slate-600">
Barcodes are an essential part of modern commerce, logistics, and inventory management. A <strong>Barcode Generator</strong> allows businesses and individuals to create scannable barcodes quickly and efficiently for products, packaging, and internal systems. Whether you run an online shop, manage a warehouse, or sell products locally, understanding how barcodes work can save time and reduce errors.
</p>
<p>
In this article, you will learn what barcodes are, how they work, and how a <strong>Barcode Generator</strong> helps you create professional barcodes in seconds.
</p>
{/* SEO Image */}
<div className="my-8 rounded-2xl overflow-hidden shadow-lg not-prose border border-slate-100">
<img
src="/barcode-generator-preview.png"
alt="Free Online Barcode Generator Preview - Create EAN, UPC, and Code 128 Barcodes"
className="w-full h-64 sm:h-80 object-cover"
/>
<div className="bg-slate-50 p-4 text-sm text-slate-500 text-center border-t border-slate-100">
Use our <strong>free barcode generator</strong> to create scannable codes.
</div>
</div>
<h3>What Is a Barcode?</h3>
<p>
A barcode is a visual representation of data that can be read by machines. It consists of vertical lines with different widths and spacing, which encode numbers or characters. When scanned with a barcode scanner or smartphone, the information is instantly translated into readable data.
</p>
<p>
Barcodes are commonly used to identify products, track inventory, manage logistics, and speed up checkout processes. They reduce manual input and significantly lower the risk of human error.
</p>
<h3>How Does a Barcode Generator Work?</h3>
<p>
A Barcode Generator converts text or numeric input into a barcode format that scanners can read. The process is simple:
</p>
<ul className="list-none pl-0 space-y-4 not-prose my-8">
<li className="flex gap-4">
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">1</div>
<div>
<strong className="text-slate-900 block mb-1">Input Data</strong>
<p className="text-slate-600 m-0 text-base">You enter a number or text (for example, a product ID).</p>
</div>
</li>
<li className="flex gap-4">
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">2</div>
<div>
<strong className="text-slate-900 block mb-1">Select Format</strong>
<p className="text-slate-600 m-0 text-base">You select a barcode format such as EAN-13 or Code 128.</p>
</div>
</li>
<li className="flex gap-4">
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">3</div>
<div>
<strong className="text-slate-900 block mb-1">Generate</strong>
<p className="text-slate-600 m-0 text-base">The generator creates a scannable barcode image instantly.</p>
</div>
</li>
<li className="flex gap-4">
<div className="w-8 h-8 mt-1 rounded-full bg-slate-100 flex items-center justify-center shrink-0 text-slate-600 font-bold text-sm">4</div>
<div>
<strong className="text-slate-900 block mb-1">Download</strong>
<p className="text-slate-600 m-0 text-base">You download or print the barcode for use.</p>
</div>
</li>
</ul>
<p>
A modern <strong>Barcode Generator</strong> works directly in the browser and does not require additional software.
</p>
<h3>Common Types of Barcodes</h3>
<p>
Different barcode formats are used for different purposes. Choosing the right one is important for compatibility and scanning accuracy.
</p>
<div className="grid md:grid-cols-2 gap-6 not-prose my-8">
{/* EAN-13 Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<Tag className="w-5 h-5 text-blue-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">EAN-13</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Retail Europe</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="EAN-13 Barcode Sample for International Products" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
EAN-13 is widely used in retail, especially in Europe. It is designed for consumer products sold in stores and supermarkets.
</p>
</div>
{/* UPC-A Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<ShoppingCart className="w-5 h-5 text-indigo-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">UPC-A</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Retail USA/Canada</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="UPC-A Barcode Example for Retail Products in USA" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
UPC-A is similar to EAN-13 but is mainly used in the United States and Canada for retail products.
</p>
</div>
{/* Code 128 Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<Settings className="w-5 h-5 text-emerald-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">Code 128</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Logistics Universal</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="Code 128 Barcode for Inventory and Shipping Labels" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
Code 128 is a flexible barcode format that supports letters and numbers. It is commonly used in logistics, shipping, and internal tracking systems.
</p>
</div>
{/* Code 39 Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<Factory className="w-5 h-5 text-orange-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">Code 39</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Industrial Military</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="Code 39 Barcode for Industrial Use" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
The first alphanumeric barcode, Code 39 is still widely used in automotive and defense industries. It supports numbers and uppercase letters.
</p>
</div>
{/* MSI Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<Layers className="w-5 h-5 text-purple-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">MSI</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Inventory Shelves</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="MSI Barcode for Inventory Management" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
MSI (Modified Plessey) is often used for inventory control in retail environments, such as labeling shelves in supermarkets and warehouses.
</p>
</div>
{/* Pharmacode Card */}
<div className="bg-white p-6 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow">
<div className="flex items-center gap-3 mb-3">
<Activity className="w-5 h-5 text-red-500" />
<h4 className="text-lg font-bold text-slate-900 m-0">Pharmacode</h4>
</div>
<div className="text-xs font-mono bg-slate-100 inline-block px-2 py-1 rounded text-slate-500 mb-3">Pharma Packaging</div>
<div className="mb-3 bg-slate-50 rounded border border-slate-100 p-2 flex justify-center">
<img src="/barcode-generator-preview.png" alt="Pharmacode for Pharmaceutical Packaging" className="h-10 object-contain opacity-75 grayscale" />
</div>
<p className="text-sm text-slate-600 m-0">
Pharmacode is a specialized barcode standard used in the pharmaceutical industry for packaging control to prevent medication errors.
</p>
</div>
</div>
<h3>Why Use a Barcode Generator?</h3>
<p>Using a Barcode Generator offers several advantages:</p>
<div className="not-prose grid gap-4 mb-8">
<div className="flex gap-4 items-start">
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
<div>
<h5 className="font-bold text-slate-900 m-0">Speed</h5>
<p className="text-slate-600 text-sm m-0">Create barcodes instantly without technical knowledge.</p>
</div>
</div>
<div className="flex gap-4 items-start">
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
<div>
<h5 className="font-bold text-slate-900 m-0">Accuracy</h5>
<p className="text-slate-600 text-sm m-0">Reduce manual data entry errors.</p>
</div>
</div>
<div className="flex gap-4 items-start">
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
<div>
<h5 className="font-bold text-slate-900 m-0">Flexibility</h5>
<p className="text-slate-600 text-sm m-0">Generate barcodes for different formats and use cases.</p>
</div>
</div>
<div className="flex gap-4 items-start">
<CheckCircle className="w-5 h-5 text-green-500 mt-1 shrink-0" />
<div>
<h5 className="font-bold text-slate-900 m-0">Cost-effective</h5>
<p className="text-slate-600 text-sm m-0">No need for expensive software or hardware.</p>
</div>
</div>
</div>
<p>
For small businesses, online shops, and startups, a <strong>free Barcode Generator</strong> is often the easiest way to get started.
</p>
<h3>Barcode vs QR Code</h3>
<p>
Although barcodes and QR codes are often confused, they serve different purposes. A barcode stores data horizontally and is mainly used for product identification. A <Link href="/tools/url-qr-code" className="text-blue-600 hover:underline">QR code</Link> stores data both horizontally and vertically and can contain more complex information such as URLs or <Link href="/tools/vcard-qr-code" className="text-blue-600 hover:underline">contact details</Link>.
</p>
<p>
If you only need to identify products or inventory items, a classic barcode is usually the better choice.
</p>
<h3>Are Barcodes Free to Use?</h3>
<p>
The barcode image itself can be generated for free using a Barcode Generator. However, for retail products sold internationally, the barcode number may need to be officially registered through organizations such as GS1. This ensures that the barcode is unique and recognized globally.
</p>
<p>
For internal use, testing, or small projects, free barcode generation is usually sufficient.
</p>
<h3>Use Cases for Barcodes</h3>
<p>Barcodes are used in many industries, including:</p>
<ul className="list-disc pl-6 space-y-2 mb-8">
<li>Retail and e-commerce</li>
<li>Inventory and warehouse management</li>
<li>Shipping and logistics</li>
<li>Libraries and document tracking</li>
<li>Event tickets and labeling</li>
</ul>
<p>
A reliable <strong>Barcode Generator</strong> helps streamline these processes and improves efficiency.
</p>
<h3>Understanding Check Digits</h3>
<p>
Most barcodes (like EAN and UPC) include a "Check Digit"the last number in the sequence. This digit is calculated mathematically from the other numbers to ensure the barcode is scanned correctly. Even if a barcode is slightly damaged or scratched, the scanner uses the check digit to verify the integrity of the data.
</p>
<h3>Best Practices for Printing Barcodes</h3>
<p>
To ensure your barcodes scan instantly at the checkout or in the warehouse, follow these printing tips:
</p>
<ul className="list-disc pl-6 space-y-2 mb-8">
<li><strong>High Contrast:</strong> Always print black bars on a white background. Reverse colors (white bars on black) often fail to scan.</li>
<li><strong>Quiet Zone:</strong> Leave enough white space (margins) on the left and right sides of the barcode.</li>
<li><strong>Resolution:</strong> For professional labels, use <strong>SVG format</strong> (vector) or high-resolution PNGs (at least 300 DPI) to avoid blurry edges.</li>
<li><strong>Size:</strong> Do not scale the barcode too small. Standard EAN-13 codes should be at least 30mm wide for reliable scanning.</li>
</ul>
<hr className="my-12 border-slate-200" />
<div className="flex items-center gap-3 mb-6 not-prose">
<HelpCircle className="w-6 h-6 text-blue-500" />
<h3 className="text-2xl font-bold text-slate-900 m-0">Frequently Asked Questions (FAQ)</h3>
</div>
<div className="not-prose space-y-8">
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> What is a Barcode Generator?</h5>
<p className="text-slate-600">A Barcode Generator is an online tool that converts numbers or text into scannable barcode images that can be used for products, labels, and inventory systems.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> Is this barcode generator free to use?</h5>
<p className="text-slate-600">Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required. You can generate, download, and print barcodes instantly.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> Which barcode format should I use?</h5>
<p className="text-slate-600">
<strong>EAN-13:</strong> Standard for retail products in Europe and globally.<br />
<strong>UPC-A:</strong> Standard for retail products in USA/Canada.<br />
<strong>Code 128:</strong> Best for logistics, shipping, and internal tracking (supports letters & numbers).
</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> Can I download barcodes in vector format (SVG)?</h5>
<p className="text-slate-600">Yes! We offer <strong>SVG downloads</strong>. SVG files are vector-based, meaning they can be scaled to any size without losing qualityperfect for professional product packaging.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> How do I generate a barcode online?</h5>
<p className="text-slate-600">To generate a barcode online, enter your product number or text, select the desired barcode format (such as EAN-13 or Code 128), and click the generate button. The barcode will be created instantly.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> Are generated barcodes scannable?</h5>
<p className="text-slate-600">Yes, barcodes generated with a proper barcode generator are fully scannable. We generate standard-compliant barcodes readable by any standard optical or laser barcode scanner.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> Can I use these barcodes for Amazon (EAN/UPC)?</h5>
<p className="text-slate-600">You can generate the <em>image</em> for Amazon here if you already have your EAN/UPC number. However, you cannot "create" a valid global EAN number hereyou must purchase those official numbers from GS1 to sell on major platforms like Amazon.</p>
</div>
<div>
<h5 className="font-bold text-slate-900 text-lg mb-2"> What is the difference between a barcode and a QR code?</h5>
<p className="text-slate-600">A barcode stores data horizontally (1D) and is mainly used for product IDs. A QR code stores data in 2D (matrix) and can hold much more information, such as URLs, vCards, or WiFi credentials.</p>
</div>
</div>
<div className="mt-12 p-6 bg-slate-900 rounded-xl text-white not-prose">
<h4 className="text-lg font-bold mb-2">Final Thoughts</h4>
<p className="text-slate-300 m-0">
A Barcode Generator is a simple yet powerful tool that helps businesses save time, reduce errors, and improve operational efficiency. By choosing the right barcode format and using a reliable generator, you can create professional barcodes that work across different systems and industries.
</p>
</div>
</div>
</section>
);
}

View File

@ -2,6 +2,7 @@
import React from 'react'; import React from 'react';
import type { Metadata } from 'next'; import type { Metadata } from 'next';
import BarcodeGeneratorClient from './BarcodeGeneratorClient'; import BarcodeGeneratorClient from './BarcodeGeneratorClient';
import { BarcodeGuide } from './BarcodeGuide';
import { Barcode as BarcodeIcon, Shield, Zap, Printer, Download, Share2, Sparkles, Sliders, Check } from 'lucide-react'; import { Barcode as BarcodeIcon, Shield, Zap, Printer, Download, Share2, Sparkles, Sliders, Check } from 'lucide-react';
import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema'; import { ToolBreadcrumb } from '@/components/seo/BreadcrumbSchema';
import { RelatedTools } from '@/components/marketing/RelatedTools'; import { RelatedTools } from '@/components/marketing/RelatedTools';
@ -10,25 +11,25 @@ import { generateSoftwareAppSchema, generateFaqSchema } from '@/lib/schema-utils
// SEO Optimized Metadata // SEO Optimized Metadata
export const metadata: Metadata = { export const metadata: Metadata = {
title: { title: {
absolute: 'Free Online Barcode Generator | Create EAN, UPC, Code 128 | QR Master', absolute: 'Barcode Generator Create Barcodes Online for Free',
}, },
description: 'Create professional, printable barcodes instantly. Erstelle EAN, UPC & Code 128 Barcodes kostenlos. Download as PNG or SVG. No sign-up required.', description: 'Use a free Barcode Generator to create scannable barcodes online. Supports EAN, UPC and Code 128 for products, labels and inventory.',
keywords: ['barcode generator', 'online barcode maker', 'create barcode free', 'ean-13 generator', 'upc-a generator', 'code 128 generator', 'barcode creator', 'printable barcodes'], keywords: ['barcode generator', 'online barcode maker', 'create barcode free', 'ean-13 generator', 'upc-a generator', 'code 128 generator', 'barcode creator', 'printable barcodes'],
alternates: { alternates: {
canonical: 'https://www.qrmaster.net/tools/barcode-generator', canonical: 'https://www.qrmaster.net/tools/barcode-generator',
}, },
openGraph: { openGraph: {
title: 'Free Online Barcode Generator | QR Master', title: 'Barcode Generator: Create EAN, UPC & Code 128',
description: 'Generate custom printable barcodes instantly. Supports EAN, UPC, Code 128.', description: 'Barcode Generator: Create professional labels instantly. Free & Secured.',
url: 'https://www.qrmaster.net/tools/barcode-generator', url: 'https://www.qrmaster.net/tools/barcode-generator',
siteName: 'QR Master', siteName: 'QR Master',
locale: 'en_US', locale: 'en_US',
type: 'website', type: 'website',
images: [{ url: '/og-barcode-generator.png', width: 1200, height: 630 }], images: [{ url: '/barcode-generator-preview.png', width: 1200, height: 630 }],
}, },
twitter: { twitter: {
card: 'summary_large_image', card: 'summary_large_image',
title: 'Free Online Barcode Generator', title: 'Free Barcode Generator',
description: 'Create custom barcodes in seconds. Download high-quality PNG/SVG.', description: 'Create custom barcodes in seconds. Download high-quality PNG/SVG.',
}, },
robots: { robots: {
@ -86,25 +87,37 @@ const jsonLd = {
totalTime: 'PT20S', totalTime: 'PT20S',
}, },
generateFaqSchema({ generateFaqSchema({
'What is the best barcode format for general use?': { 'What is a Barcode Generator?': {
question: 'What is the best barcode format for general use?', question: 'What is a Barcode Generator?',
answer: 'Code 128 is the most versatile format and is highly recommended for inventory and internal tracking as it supports both numbers and letters.', answer: 'A Barcode Generator is an online tool that converts numbers or text into scannable barcode images that can be used for products, labels, and inventory systems.',
}, },
'Which format should I use for retail?': { 'Is this barcode generator free to use?': {
question: 'Which format should I use for retail?', question: 'Is this barcode generator free to use?',
answer: 'EAN-13 is the standard for retail products in Europe and worldwide, while UPC-A is the standard for retail in North America.', answer: 'Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required. You can generate, download, and print barcodes instantly.',
}, },
'Is this barcode generator free?': { 'Which barcode format should I use?': {
question: 'Is this barcode generator free?', question: 'Which barcode format should I use?',
answer: 'Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required.', answer: 'EAN-13 is standard for retail in Europe/Global. UPC-A is standard for retail in USA/Canada. Code 128 is best for logistics and internal tracking as it supports letters and numbers.',
}, },
'Can I download barcodes in vector format?': { 'Can I download barcodes in vector format (SVG)?': {
question: 'Can I download barcodes in vector format?', question: 'Can I download barcodes in vector format (SVG)?',
answer: 'Yes, you can download your barcodes as SVG (Scalable Vector Graphics), which is ideal for high-quality printing without loss of resolution.', answer: 'Yes! We offer SVG downloads. SVG files are vector-based, meaning they can be scaled to any size without losing quality—perfect for professional product packaging.',
}, },
'Do these barcodes work with any scanner?': { 'How do I generate a barcode online?': {
question: 'Do these barcodes work with any scanner?', question: 'How do I generate a barcode online?',
answer: 'Yes, we generate standard-compliant barcodes that are universally readable by any standard optical or laser barcode scanner.', answer: 'To generate a barcode online, enter your product number or text, select the desired barcode format (such as EAN-13 or Code 128), and click the generate button. The barcode will be created instantly.',
},
'Are generated barcodes scannable?': {
question: 'Are generated barcodes scannable?',
answer: 'Yes, barcodes generated with a proper barcode generator are fully scannable. We generate standard-compliant barcodes readable by any standard optical or laser barcode scanner.',
},
'Can I use these barcodes for Amazon (EAN/UPC)?': {
question: 'Can I use these barcodes for Amazon (EAN/UPC)?',
answer: 'You can generate the image for Amazon here if you already have your EAN/UPC number. However, you cannot "create" a valid global EAN number here—you must purchase those official numbers from GS1 to sell on major platforms like Amazon.',
},
'What is the difference between a barcode and a QR code?': {
question: 'What is the difference between a barcode and a QR code?',
answer: 'A barcode stores data horizontally (1D) and is mainly used for product IDs. A QR code stores data in 2D (matrix) and can hold much more information, such as URLs, vCards, or WiFi credentials.',
}, },
}), }),
], ],
@ -146,13 +159,12 @@ export default function BarcodeGeneratorPage() {
</div> </div>
<h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6"> <h1 className="text-4xl md:text-5xl lg:text-6xl font-extrabold text-white tracking-tight leading-tight mb-6">
Professional <br className="hidden lg:block" /> Free Online <span className="text-blue-400">Barcode Generator</span>
<span className="text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-indigo-400">Online Barcode Generator</span>
</h1> </h1>
<p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed"> <p className="text-lg md:text-xl text-slate-400 max-w-2xl mx-auto lg:mx-0 mb-8 leading-relaxed">
Create and print high-quality barcodes for your products and inventory. Our <strong>barcode generator</strong> makes it easy to create and print high-quality labels for products and inventory.
<strong className="text-white block sm:inline mt-2 sm:mt-0"> Supports EAN, UPC, Code 128.</strong> <span className="text-white block sm:inline mt-2 sm:mt-0"> Supports EAN, UPC, Code 128.</span>
</p> </p>
<div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80"> <div className="flex flex-wrap justify-center lg:justify-start gap-4 text-sm font-medium text-white/80">
@ -280,60 +292,12 @@ export default function BarcodeGeneratorPage() {
{/* RELATED TOOLS */} {/* RELATED TOOLS */}
<RelatedTools /> <RelatedTools />
{/* FAQ SECTION */} {/* SEO GUIDE */}
<section className="py-16 px-4 sm:px-6 lg:px-8" style={{ backgroundColor: '#EBEBDF' }}> <BarcodeGuide />
<div className="max-w-3xl mx-auto">
<h2 className="text-3xl font-bold text-slate-900 text-center mb-4">
Frequently Asked Questions
</h2>
<p className="text-slate-600 text-center mb-10">
Common questions about our online barcode creator.
</p>
<div className="space-y-4">
<FaqItem
question="What is the best barcode format for general use?"
answer="Code 128 is the most versatile format and is highly recommended for inventory and internal tracking as it supports both numbers and letters."
/>
<FaqItem
question="Which format should I use for retail?"
answer="EAN-13 is the standard for retail products in Europe and worldwide, while UPC-A is the standard for retail in North America."
/>
<FaqItem
question="Is this barcode generator free?"
answer="Yes, our online barcode generator is completely free to use with no hidden costs or sign-ups required."
/>
<FaqItem
question="Can I download barcodes in vector format?"
answer="Yes, you can download your barcodes as SVG (Scalable Vector Graphics), which is ideal for high-quality printing without loss of resolution."
/>
<FaqItem
question="Do these barcodes work with any scanner?"
answer="Yes, we generate standard-compliant barcodes that are universally readable by any standard optical or laser barcode scanner."
/>
</div>
</div>
</section>
</div> </div>
</> </>
); );
} }
function FaqItem({ question, answer }: { question: string; answer: string }) {
return (
<details className="group bg-white rounded-xl shadow-sm border border-slate-200 overflow-hidden">
<summary className="flex items-center justify-between p-5 cursor-pointer list-none text-slate-900 font-semibold hover:bg-slate-50 transition-colors">
{question}
<span className="transition group-open:rotate-180 text-slate-400">
<svg fill="none" height="20" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" viewBox="0 0 24 24" width="20">
<path d="M6 9l6 6 6-6" />
</svg>
</span>
</summary>
<div className="text-slate-600 px-5 pb-5 pt-0 leading-relaxed text-sm">
{answer}
</div>
</details>
);
}