Free Barcode API
Put a URL in an image tag, a spreadsheet or a label template and get a barcode back as a PNG. No API key, no account, no request to sign.
This URL
https://useqrkit.com/barcode?bcid=code128&text=ABC-12345&includetext
returns this image, drawn live by the API:
Quick start
One URL, One Barcode
Every request is a GET to https://useqrkit.com/barcode with the barcode type in bcid and the value in text. URL-encode the value so spaces, & and # survive.
HTML
<img src="https://useqrkit.com/barcode?bcid=code128&text=ABC-12345&includetext"
alt="Code 128 barcode for ABC-12345">Google Sheets or Excel (value in A1)
=IMAGE("https://useqrkit.com/barcode?bcid=code128&includetext&text="&ENCODEURL(A1))JavaScript
const src = "https://useqrkit.com/barcode?" +
new URLSearchParams({ bcid: "ean13", text: "590123412345", includetext: "" });Download with curl
curl -o label.png "https://useqrkit.com/barcode?bcid=gs1-128&text=(01)09521234543213(10)ABC123&includetext&scale=3"In Google Sheets, the first time a spreadsheet loads an outside image it asks you to Allow access. Click it once and the barcodes appear. Need QR codes from a formula instead? See the Google Chart API QR code replacement.
Barcode types
Common bcid Values
Each image below is drawn live from its URL. The API supports 111 types in all; these are the ones most people need.
GS1-128
Cases and pallets with GS1 data
bcid=gs1-128
GS1 DataMatrix
Healthcare and products with expiry dates
bcid=gs1datamatrix
Reference
Parameters
The names are the ones the bwip-js library uses, so a URL written for the bwip-js online API works here unchanged.
| Parameter | What it does |
|---|---|
| bcid | Required. The barcode type, such as code128, ean13, upca, qrcode or datamatrix. See the table below. |
| text | Required. The value to encode, URL-encoded. |
| includetext | Prints the value under the bars. Add it with no value, or set includetext=false. |
| scale | Pixels per module, 1 to 10. Left out, it is 2. scaleX and scaleY set each direction. |
| height | Bar height in millimetres for linear barcodes, such as height=15. |
| rotate | N (normal), R (90° clockwise), L (90° counterclockwise) or I (180°). |
| barcolor, backgroundcolor, textcolor | Hex colors such as 1A1A1A. The background is white unless you change it. |
| padding | The quiet zone on every side. Left out, linear barcodes get 10 modules left and right and 2D codes get 4 all round. As in bwip-js, it counts modules for linear codes and half-modules for 2D codes. |
| alttext, parsefnc, eclevel, version, columns, rows | Passed to the encoder for types that use them, as in the bwip-js documentation. |
- A mistake, such as a wrong check digit or letters in an EAN, gets a 400 response with a one-line plain-text reason.
- Images can be up to 4,000,000 pixels. Lower the scale if a long Code 128 goes over.
- The same URL always draws the same image, so responses are cached for a year.
- Parameters not listed here are ignored rather than refused.
- An ISBN needs its hyphens, like 978-1-56581-231-4. For the bare 13-digit number, use bcid=ean13.
Switching over
Moving From TEC-IT or the bwip-js Online API
Two barcode image URLs show up in most old tutorials and templates. TEC-IT's free generator is offered for non-commercial sites in return for a back-link, and the bwip-js online API is a single community-run server whose own documentation suggests hosting your own. If you rely on either, this API reads the same parameters, so the change is the start of the URL.
| Replace | With |
|---|---|
| https://barcode.tec-it.com/barcode.ashx? | https://useqrkit.com/barcode? |
| https://bwipjs-api.metafloor.com/? | https://useqrkit.com/barcode? |
TEC-IT parameters we read
- data
- The value to encode
- code
- The barcode type: Code128 (the default), EAN13, EAN8, UPCA, Code39, Code25IL, QRCode, MobileQRCode, DataMatrix, PDF417 and others
- dpi
- Size: 96 dpi, TEC-IT's default, is scale 2
- rotation
- 0, 90, 180 or 270
- color, bgcolor
- Bar and background colors
- hidehrt
- Hide the text under linear barcodes, which shows by default
- eclevel
- QR code error correction
The answer is always a PNG, whatever imagetype asks for; image tags and spreadsheets accept it either way. TEC-IT's escape sequences (translate-esc) are not translated, so send GS1 data in the bwip-js form, such as bcid=gs1-128&text=(01)09521234543213.
Barcode API: FAQ
Making a handful of barcodes by hand? The barcode generator draws them in your browser and exports PNG, SVG or PDF, and the check digit calculator checks up to 500 numbers at once.
Writing a tutorial or template that uses this API? A link to this page is appreciated, but never required.