Free plan

Barcode

Make a barcode from a number or text
POST
/v1/images/barcode

About this tool

Draws a barcode, the black stripes that shops scan, from the number or text you type. Pick the barcode type (for example Code 128, EAN-13 or UPC-A), the colours, the size, and whether the numbers are printed under the stripes. Each type accepts different characters, for instance EAN-13 needs digits only. This tool needs no file.
For example, you type a product number and get a barcode to print on a label.

How to use it

  1. Choose this tool.
  2. Choose the barcode type.
  3. Type the number or text the barcode should hold.
  4. Set the colours, size and file type if you wish, then press Generate.
  5. Download your barcode.

What you get back

You get a barcode as a PNG picture, an SVG drawing or a PDF, ready to download and print.
TEST IT LIVE

Try Barcode in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
Images
Plan
Free
Method
POST
Endpoint
/v1/images/barcode
Tool ID
images.barcode
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Image
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/images/barcode" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'symbology=code128' \
  -F 'text=example' \
  -F 'file_type=png'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.images.barcode({
    "symbology": "code128",
    "text": "example",
    "file_type": "png"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->images()->barcode([
    'symbology' => 'code128',
    'text' => 'example',
    'file_type' => 'png',
]);
echo $result->requestId;
FAQ

Frequently asked questions

A barcode as PNG, SVG or PDF. Symbologies: code128 (Code 128: any ASCII text); code39 (Code 39: A-Z 0-9 – . $ / + % space); ean13 (EAN-13: 12 digits (the check digit is added) or 13); ean8 (EAN-8: 7 digits (the check digit is added) or 8); upca (UPC-A: 11 digits (the check digit is added) or 12); itf (Interleaved 2 of 5: an even number of digits); codabar (Codabar: digits and – $ : / . + between start/stop letters A-D); datamatrix (Data Matrix: any text); pdf417 (PDF417: any text); aztec (Aztec: any text); qrcode (QR Code (barcode renderer): any text). Each one is proven by generating it and reading it back. Counts as one file.

Barcode works from text and settings, so no file is needed. The required inputs are symbology, text.

Barcode is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/images/barcode with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.