LinuxCommandLibrary

qrencode

Generate QR Code from text or data

TLDR

Convert a string to a QR code and save to an output file

$ qrencode [[-o|--output]] [path/to/output_file.png] [string]
copy

Convert an input file to a QR code and save to an output file
$ qrencode [[-o|--output]] [path/to/output_file.png] [[-r|--read-from]] [path/to/input_file]
copy

Convert a string to a QR code and print it in terminal
$ qrencode [[-t|--type]] ansiutf8 [string]
copy

Convert input from pipe to a QR code and print it in terminal
$ echo [string] | qrencode [[-t|--type]] ansiutf8
copy

SYNOPSIS

qrencode [options] [input string or file]

PARAMETERS

-o
    Specify the output file name. If omitted, the output will be printed to stdout as a PBM image.

-t
    Specify the output type (e.g., PNG, SVG, ANSI). Default is PNG.

-s
    Specify the size of the QR Code module in pixels. Default is 3.

-m
    Specify the margin size around the QR Code in modules. Default is 4.

-l
    Specify the error correction level (L, M, Q, H). Default is L.

-v
    Specify the QR Code version (1-40). Default is auto.

-d
    Specify the input data to be encoded. If omitted, data will be read from stdin.

-r
    Specify the resolution (DPI) for raster output (e.g., PNG). Default is 72.

-f
    Read input data from a file.

-8
    Encode in 8-bit mode.

-S
    Output as structured symbol.

-k
    Keep the intermediate files. Only useful for debugging

-V
    Show version information.

DESCRIPTION

qrencode is a command-line tool that encodes text data into a QR Code image. It takes string input, either directly or from a file, and generates QR Code images in various formats, including PNG, SVG, and terminal output.
It is widely used to create QR Codes for URLs, contact information, Wi-Fi passwords, and other data that can be easily scanned by smartphones and other devices. qrencode supports different QR Code versions, error correction levels, and encoding modes. It provides options to customize the output image, such as specifying the size, margin, and background color.
The main strength is the simple and quick generation of usable QR codes, that are a very common tool in everyday life.

OUTPUT FORMATS

qrencode supports various output formats, including PNG, SVG, EPS, and terminal-based output using ANSI escape codes. The choice of format depends on the intended use of the QR Code. PNG is suitable for web pages and images, SVG for scalable vector graphics, and ANSI for displaying QR Codes in terminal emulators.

SEE ALSO

zbarimg(1)

Copied to clipboard