Free Barcode Generator Online
Create Code 128 barcodes for labels, SKUs and shipping with a single request. SVG with human-readable text or PNG, custom height, width and colours.
Result
Press “Run” to see the result.
The Barcode API generates Code 128 barcodes, the most widely used linear barcode for shipping labels, warehouse SKUs, invoices and internal asset tags. Send GET /v1/barcode?text=ABC-12345 and receive a crisp SVG image; add format=png for a bitmap.
The encoder automatically switches between Code 128 set B (all printable ASCII characters) and set C (pairs of digits) so long numeric runs produce a compact barcode, and it calculates the check digit for you. The text can be up to 80 printable ASCII characters; accented or non-Latin characters are rejected with a clear error.
Options: height of the bars (20–600 px, default 80), module_width (1–10 px per narrow bar, default 2), foreground color and background, and show_text=false to hide the human-readable line printed under the SVG barcode (PNG output contains the bars only).
Use this in your code
curl "https://apibox.io.vn/v1/barcode?text=ABC-12345&height=80" \
-H "Authorization: Bearer YOUR_API_KEY" \
-o outputconst res = await fetch('https://apibox.io.vn/v1/barcode?text=ABC-12345&height=80', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
},
});
const blob = await res.blob();import requests
res = requests.get(
"https://apibox.io.vn/v1/barcode?text=ABC-12345&height=80",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
open("output", "wb").write(res.content)<?php
$ch = curl_init('https://apibox.io.vn/v1/barcode?text=ABC-12345&height=80');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY'],
]);
$response = curl_exec($ch);
file_put_contents('output', $response);API documentation → Get a free API key
FAQ
Which barcode symbology does the API produce?
Code 128 (sets B and C with automatic switching). It is read by virtually every handheld and camera scanner. EAN-13/UPC and 2D formats other than QR are not generated; use /v1/qr for QR codes.
Can I encode Vietnamese or other accented characters?
No. Code 128 only covers printable ASCII (codes 32–126), so the API returns an invalid_text error. Remove diacritics or encode an ID instead.
SVG or PNG – which is better for printing?
SVG is vector and stays sharp at any print size, and it includes the human-readable text. Use PNG when the target (some label printers or e-mail clients) cannot render SVG; pick a module_width of 2–4 for good scan quality.