Make a barcode
Retail systems still run on linear barcodes decades after everyone assumed QR codes would replace them, because a checkout scanner reading a UPC in a fraction of a second is a solved problem nobody wants to re-solve. This barcode generator api renders EAN, UPC, Code128, Code39 and ITF symbologies from a plain product code, producing an image that a standard laser or camera scanner reads correctly the first time.
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
Five symbologies, five different jobs
EAN-13 and UPC-A are the two symbologies stamped on almost every retail product worldwide, EAN dominant outside North America and UPC inside it, both built around a fixed-length numeric code assigned through a product numbering registry. Code128 packs any combination of letters, numbers and symbols into a compact symbol, which is why shipping labels and internal logistics tags favor it over the retail formats. Code39 is older and less dense but decodes reliably even on cheap scanners, which keeps it alive in industrial and government settings. ITF, short for Interleaved 2 of 5, encodes pairs of digits efficiently and shows up mostly on cardboard cartons and outer packaging where print quality is inconsistent.
What POST /dev/barcode-generate needs from you
You send the symbology you want and the code to encode; EAN and UPC formats validate that the digits match the length and check-digit rules the standard requires, since a barcode with an invalid check digit will simply fail to scan or worse, scan as the wrong product. Code128 and Code39 accept a broader character set. The task returns a rendered image sized and proportioned to scan reliably, delivered by signed webhook or a signed link valid for 24 hours.
A format older than most of the software stack
The linear barcode traces back to a patent filed in 1952, but it only became commercially practical in 1974, when a pack of Wrigley's gum became the first retail product scanned at a checkout using the UPC symbology. Half a century later, that same basic idea, black and white bars of varying width encoding a numeric string, still moves more physical goods through checkout lanes and warehouses than any newer format has managed to displace.
How this fits an automated catalog pipeline
Product management systems that assign a new SKU and need a print-ready barcode the same second, label printers driven by a warehouse management system generating hundreds of Code128 tags per shift, and e-commerce platforms rendering an EAN image on a product page all call this endpoint the same way, with no manual design step between assigning the code and having a scannable image. Bulk generation for a full catalog import runs through the same asynchronous task model as a single code.
Choosing the right symbology
If the product will be sold at retail and already has an assigned EAN or UPC, use that exact symbology, the number is already registered and changing formats isn't an option. For internal logistics, shipping labels or anything needing letters as well as digits, Code128 is the practical default. Code39 remains relevant mainly for compatibility with older industrial scanners, and ITF is the right call specifically for outer carton labeling.
What you can do with it
New SKU onboarding in a product catalog
Generate a scan-ready EAN or UPC image the moment a new product is assigned its official code, ready to print on packaging.
Warehouse label printing at scale
Produce Code128 labels for internal logistics tracking across an entire shift's worth of outbound shipments in one batch.
Outer carton labeling for bulk shipments
Generate ITF barcodes suited to the lower print quality typical of corrugated cardboard cartons in a distribution run.
Legacy scanner compatibility in industrial settings
Produce Code39 labels for equipment tracking where the installed scanner fleet only reads that older, simpler symbology.
FAQ
Which symbologies does this barcode generator api support?
EAN, UPC, Code128, Code39 and ITF, each validated and rendered according to the rules that specific standard requires.
Does it validate the check digit for EAN and UPC codes?
Yes, EAN and UPC inputs are checked against the length and check-digit rules the standard requires before an image is rendered.
Can Code128 encode letters as well as numbers?
Yes, Code128 accepts a broad character set including letters and symbols, which is why it's common for shipping and logistics labels rather than retail products.
What's the difference between EAN and UPC?
Both are fixed-length numeric retail symbologies; EAN is the standard used outside North America and UPC the one used within it, and a product's assigned registry number determines which applies.
Is there a free plan for generating barcodes?
The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.
How much does generating a barcode cost?
$0.002 per request plus $0.005 per image, charged only for tasks that complete successfully.
Can I generate barcodes in bulk for a catalog import?
Yes, batches of any size run asynchronously, so a full catalog import can be submitted at once without blocking your application.
How do I receive the generated barcode image?
POST /dev/barcode-generate returns a task_id immediately, and the image is delivered via signed webhook or a signed link valid for 24 hours.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/dev/barcode-generate \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"image":"https://ejemplo.com/imagen.jpg"}'const res = await fetch("https://api.kit.forhosting.com/dev/barcode-generate", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"image": "https://ejemplo.com/imagen.jpg"
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/dev/barcode-generate",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"image": "https://ejemplo.com/imagen.jpg"
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/dev/barcode-generate", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"image":"https://ejemplo.com/imagen.jpg"}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"image":"https://ejemplo.com/imagen.jpg"}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/dev/barcode-generate", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"image": "https://ejemplo.com/imagen.jpg"
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "dev.barcode_generate",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |