📊

Barcode Generator

Generate barcodes in 11 symbologies including Code 128, EAN-13, and UPC-A

GET 1 credit /v1/barcode/generate
curl "https://barcode.toolkitapi.io/v1/barcode/generate?data=ABC-12345&barcode_type=code128"
import httpx

resp = httpx.get(
    "https://barcode.toolkitapi.io/v1/barcode/generate?data=ABC-12345&barcode_type=code128",
)
print(resp.json())
const resp = await fetch("https://barcode.toolkitapi.io/v1/barcode/generate?data=ABC-12345&barcode_type=code128", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
<raw PNG image bytes — embed directly in an <img> tag or save to disk>

Try It Live

Live Demo

Description

Generate barcodes in 11 symbologies including Code 128, EAN-13, and UPC-A

How to Use

1

1. Make a GET request with `data` set to the value to encode and `barcode_type` set to the desired symbology (e.g. `code128`, `ean13`, `upca`).

2

2. Optionally add `format` (`png` or `svg`), `fg_color` and `bg_color` (hex values), `module_height`, `quiet_zone`, and `include_text` as query parameters.

3

3. The response is the raw image — use the URL directly as an image source or pipe the bytes to a file: - `` - `curl "..." -o barcode.png`

About This Tool

Use the Barcode Generator to create production-ready 1D barcodes in any of 11 supported symbologies. Pass your data and barcode type as query parameters and the API returns the raw PNG or SVG image directly — ready to embed in labels, invoices, inventory systems, or anywhere an image URL is accepted.

You can customise bar colour, background colour, bar height, quiet zone width, and whether human-readable text appears below the barcode.

Why Use This Tool

Frequently Asked Questions

What barcode types are supported?
The API supports 11 symbologies: Code 128, Code 39, EAN-13, EAN-8, EAN-14, UPC-A, ISBN-13, ISBN-10, ISSN, PZN, and ITF. Use the `/v1/barcode/types` endpoint for detailed info on each.
Do I need to calculate the check digit for EAN/UPC barcodes?
No — the API auto-calculates the check digit. For EAN-13, you can pass either 12 or 13 digits. If you pass 12, the checksum is appended automatically.
Can I customise the barcode colours?
Yes. Use `fg_color` for the bar colour and `bg_color` for the background. Both accept standard hex colour codes (e.g. `#FF0000` for red bars). Be mindful that low-contrast colour combinations may reduce scannability.

Start using Barcode Generator now

Get your free API key and make your first request in under a minute.