What is this?
ean13.wrid.org is a simple, public service that generates EAN‑13 barcodes as standards-compliant images (SVG or PNG). It is designed for long-term use in publishing, retail, libraries, education, and archival material.
No tracking. No analytics. No URL shorteners. Just encoding.
Generate an EAN‑13 barcode
The result will be returned as an image (SVG by default, PNG if requested via the Accept header).
How to use it
-
https://ean13.wrid.org?encode=9780306406157 -
https://ean13.wrid.org?encode=9780306406157&px=1200&h=320(larger PNG + custom bar height) - Returns image/svg+xml or image/png based on the Accept header
- Cacheable and deterministic
You can embed the result directly in documents, PDFs, or HTML without further processing.
Parameters
encode— EAN‑13 digits to encode (required; accepts 12 digits to auto-add the check digit, or 13 digits with a valid check digit)px— Target PNG width in pixels (optional; default 600; min 300; max 2400)h— Bar height in pixels (optional; default 260; min 80; max 600)
What do px and h actually change?
EAN‑13 is a fixed-width symbol (117 modules including quiet zones), so image sizing is mostly about
selecting an appropriate module width and an appropriate bar height for where the barcode
will be printed.
-
pxcontrols the target PNG width. The server chooses an integer module size so the resulting PNG is roughly that many pixels wide. (This is mainly for print-quality PNG output.) -
hcontrols the bar height in pixels. This affects both PNG and SVG so that the two representations can match visually.
Tip: For print at 300 DPI, a 2" wide barcode is ~600 px. For back covers and labels, many workflows prefer 900–1200 px PNGs to allow comfortable scaling and cropping.
Content negotiation
This service supports HTTP content negotiation. The
same URL can return different representations depending on the
Accept header sent by the client.
- image/svg+xml — returns an SVG EAN‑13 barcode (default)
- image/png — returns a PNG EAN‑13 barcode
- text/html — returns this documentation page
This allows the same endpoint to be used interactively by humans and
programmatically by machines, without changing URLs. Note: h applies to both SVG and PNG;
px applies to PNG output.
CURL Examples
Generate SVG
Best for layout tools and vector workflows (InDesign, LaTeX, web). Use h to match a print layout.
curl -H "Accept: image/svg+xml" \
"https://ean13.wrid.org/?encode=9780306406157" \
--output ean13.svg
Generate PNG
Best for raster-only workflows. Use px to request a print-friendly size.
curl -H "Accept: image/png" \
"https://ean13.wrid.org/?encode=9780306406157" \
--output ean13.png
Generate PNG with custom size
Example: a larger PNG plus a taller bar height for book covers, labels, and production PDFs.
curl -H "Accept: image/png" \
"https://ean13.wrid.org/?encode=9780306406157&px=1200&h=320" \
--output ean13-1200x320.png
Why another barcode generator?
Most barcode generators today are marketing tools. This one is infrastructure.
- No dependency on third-party APIs
- Open, inspectable output
- Stable URLs
- Built for long-lived documents
What’s next?
In the future, paths like
ean13.wrid.org/<id>
will resolve EAN‑13 barcodes backed by WRID records.
The current ?encode= endpoint will remain available.