data string required Payload to encode. For type=ean13: 13 digits with a valid check digit, or 12 digits to have it computed and appended. For type=code128: 1–40 characters of printable ASCII (space–~).
Real, scannable SVG barcodes — EAN-13 with automatic check digits and Code 128 set B. Custom height, optional label, deterministic and safe to hotlink.
Authoritative reference data or standards computation
Returns the barcode itself (image/svg+xml), not JSON. EAN-13 validates (or computes) the check digit; Code 128 encodes printable ASCII in set B with its check symbol.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
data
required
| string | allowed: ≤ 40 example: 5901234123457 | Payload to encode. For type=ean13: 13 digits with a valid check digit, or 12 digits to have it computed and appended. For type=code128: 1–40 characters of printable ASCII (space–~). |
type | enum | default: ean13 allowed: ean13 | code128 example: code128 | Symbology: 'ean13' = retail product codes (L/G/R patterns, mod-10 check digit), 'code128' = free-text code set B with mod-103 check symbol. |
height | int | default: 120 allowed: 40 – 400 example: 200 | Bar height in pixels (40–400). The image is 24 px taller when showText=true. |
showText | boolean | default: true example: false | Print the encoded value under the bars in a monospace font. For EAN-13 the label is always the full 13 digits, including a computed check digit. |
data string required Payload to encode. For type=ean13: 13 digits with a valid check digit, or 12 digits to have it computed and appended. For type=code128: 1–40 characters of printable ASCII (space–~).
type enum Symbology: 'ean13' = retail product codes (L/G/R patterns, mod-10 check digit), 'code128' = free-text code set B with mod-103 check symbol.
height int Bar height in pixels (40–400). The image is 24 px taller when showText=true.
showText boolean Print the encoded value under the bars in a monospace font. For EAN-13 the label is always the full 13 digits, including a computed check digit.
/api/barcodes/image?data=5901234123457 /api/barcodes/image?data=590123412345&height=160 /api/barcodes/image?data=INV-2024-0042&type=code128&showText=false Returns an actual SVG barcode (Content-Type: image/svg+xml) — a real, scannable encoding, not decorative stripes. Drop it into an <img src>, a label template or a test fixture.
Two symbologies:
data must be 13 digits with a valid mod-10 check digit, or 12 digits to have the check digit computed and appended for you (it then appears in the label). A wrong 13th digit is a 400 that tells you the expected digit — never a silently broken barcode. Bars use the genuine L/G/R pattern tables with first-digit parity selection: 95 modules — start/center/end guards plus twelve 7-module digit symbols.type=code128) — free text: 1–40 characters of printable ASCII (space to ~). Encoded with the Start B code, the mod-103 check symbol and the 13-module stop pattern, exactly as scanners expect.Rendering: black bars on a white background at 2 px per module with 10-module quiet zones on both sides, so the image width follows the data length. height sets the bar height (40–400 px); showText=true (default) prints the encoded value under the bars in a monospace font and adds 24 px to the image height. The output is fully deterministic — the same URL returns a byte-identical SVG forever and is served with long cache headers, so it is safe to hotlink.
Yes — bar widths follow the real EAN-13 and Code 128 encoding tables and EAN-13 check digits are computed correctly, so a phone scanner reads them.
Yes — pass data and pick type=ean13 or type=code128; the barcode encodes exactly that value.
Crisp SVG that scales without blurring; height and showText control the bar height and the human-readable line.
Fake e-commerce products with category-themed names, prices in real currencies (whole yen for JPY), valid EAN-13 barcodes, SKUs, ratings and image URLs.
Hotlinkable SVG placeholder images at any size from 8 to 4000 px — custom label, colors and an optional gradient. Deterministic and crisp at every scale.
Clearly fake API keys, JWTs and hex/base64 secrets — structurally valid enough to exercise parsers and middleware, cryptographically meaningless by design.
Scannable ISO/IEC 18004 QR codes as SVG — L/M/Q/H error correction, custom module size, quiet zone and colours, byte-identical for a given request URL.