Introduction
Welcome to the documentation for URL-to-[QR,Code39,Data Matrix], a straightforward and efficient web service designed to generate QR codes, Code39, and Data Matrix barcodes dynamically. Simply construct a URL containing the text you wish to encode, and the service will return the corresponding barcode image.
This service is currently hosted at https://gen.printercow.com/. It leverages the power of Rust and high-quality libraries to deliver fast and reliable barcode generation.
Hosting & Performance: The service is currently hosted on servers located in Frankfurt, Germany. Users within Europe should typically experience very low latency, often sub-30ms for barcode generation requests.
We aim to provide the best possible performance globally. If you are experiencing high latency and would benefit from hosting in a different region, please let us know where you'd like to see servers deployed next! You can reach us at hello@printercow.com.
Usage
To generate a barcode, make a GET request to the appropriate endpoint at
https://gen.printercow.com/
. The text you want to encode should be appended to the URL
path.
{text_to_encode}
)
must be URL-encoded if it contains special characters like spaces, slashes,
question marks, etc. Most programming languages and tools have built-in functions for URL encoding
(e.g., JavaScript's encodeURIComponent()
, Python's urllib.parse.quote()
).
QR Code Generation
https://gen.printercow.com/qr/svg/{text_to_encode}
SVG
Generates a QR code in Scalable Vector Graphics (SVG) format.
Parameter: {text_to_encode}
- The URL-encoded
text to embed in the QR code (max 1000 characters).
# Using curl
curl "https://gen.printercow.com/qr/svg/https%3A%2F%2Fprintercow.com" -o printercow_qr.svg
# In HTML

https://gen.printercow.com/qr/png/{text_to_encode}
PNG
Generates a QR code in Portable Network Graphics (PNG) format.
Parameter: {text_to_encode}
- The URL-encoded
text to embed in the QR code (max 1000 characters).
# Using curl
curl "https://gen.printercow.com/qr/png/Check%20out%20Printercow%21" -o printercow_qr.png
# In HTML

Code39 Barcode Generation
https://gen.printercow.com/code39/svg/{text_to_encode}
SVG
Generates a Code39 barcode in Scalable Vector Graphics (SVG) format.
Parameter: {text_to_encode}
- The URL-encoded
text to encode. Max 1000 characters. Must only contain valid Code39 characters (see note below).
Input text is automatically converted to uppercase.
# Using curl
curl "https://gen.printercow.com/code39/svg/CODE-39%20EXAMPLE%20123" -o code39_example.svg
# In HTML

https://gen.printercow.com/code39/png/{text_to_encode}
PNG
Generates a Code39 barcode in Portable Network Graphics (PNG) format (default height: 80px).
Parameter: {text_to_encode}
- The URL-encoded
text to encode. Max 1000 characters. Must only contain valid Code39 characters (see note below).
Input text is automatically converted to uppercase.
# Using curl
curl "https://gen.printercow.com/code39/png/ASSET%2F%24123.45" -o code39_asset.png
# In HTML

400 Bad Request
error will be
returned.
Data Matrix Generation
Data Matrix is a two-dimensional code consisting of black and white "cells" or modules arranged in either a square or rectangular pattern, also known as a matrix. It can encode text, numbers, and raw binary data, offering high density and error correction.
https://gen.printercow.com/datamatrix/svg/{text_to_encode}
SVG
Generates a Data Matrix barcode in Scalable Vector Graphics (SVG) format. This format is ideal for high-resolution printing and scaling without quality loss. The generated SVG uses a rectangular symbol shape when appropriate for the data.
Parameter: {text_to_encode}
- The URL-encoded
text or data to embed in the Data Matrix code (max 1000 characters).
# Using curl
curl "https://gen.printercow.com/datamatrix/svg/PartID%3A%20SN123456789" -o datamatrix_part.svg
# In HTML

https://gen.printercow.com/datamatrix/png/{text_to_encode}
PNG
Generates a Data Matrix barcode in Portable Network Graphics (PNG) format. Suitable for web display and general use. The generated PNG uses a square symbol shape when appropriate for the data.
Parameter: {text_to_encode}
- The URL-encoded
text or data to embed in the Data Matrix code (max 1000 characters).
# Using curl
curl "https://gen.printercow.com/datamatrix/png/https%3A%2F%2Fprintercow.com%2Fdocs" -o datamatrix_url.png
# In HTML

Error Handling
The service uses standard HTTP status codes to indicate success or failure:
200 OK
: The barcode was generated successfully. The response body contains the image data (SVG or PNG).400 Bad Request
: This usually indicates an issue with the input text. Common causes include:- The
{text_to_encode}
path segment is missing or empty. - For Code39, the text contains characters not allowed in the Code39 character set.
- The
413 Payload Too Large
: The provided{text_to_encode}
exceeds the maximum allowed length (1000 characters).500 Internal Server Error
: An unexpected error occurred on the server while generating the barcode. Please contact hello@printercow.com if you encounter persistent errors.
Error responses will typically include a plain text message in the body explaining the issue.
Limitations
- Maximum Text Length: The input text for encoding is limited to
1000
characters. Requests exceeding this limit will receive a413 Payload Too Large
error. - Code39 Character Set: Only valid Code39 characters are supported (uppercase A-Z, 0-9, space, -, ., $, /, +, %).
- Barcode Types: Currently, QR Code, Code39, and Data Matrix are supported. Let us know if you need support for other barcode types!
Usage Terms, Privacy & Contact
The URL-to-[QR,Code39,Data Matrix] service at https://gen.printercow.com/
is
completely free to use for any purpose, whether personal or commercial, without any
attribution requirements or limitations.
Privacy Commitment: We are committed to user privacy. No personally identifiable information or the content you encode is logged or stored. We do not log IP addresses, user agents, or the text/data you submit for barcode generation.
The only metric recorded is a simple, anonymous counter that increments each time a specific type of barcode (QR, Code39, Data Matrix) is generated. This counter helps us understand general usage patterns (e.g., "100 QR codes were generated today") without tracking any specific request or user.
For questions, feedback, bug reports, feature requests, or inquiries about hosting, please contact us at: hello@printercow.com.
Acknowledgements
This service relies on several high-quality open-source libraries. Special thanks to the maintainers of:
- Salvo - Web framework.
- fast_qr - QR code generation.
- barcoders - Barcode generation (Code39).
- datamatrix-rs - Data Matrix generation.
- image - Image processing (for PNG output).
- Tokio - Asynchronous runtime.
- Tracing - Logging.
- The Rust Programming Language community.