LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

qrtool

Command-line utility for encoding and decoding QR codes

TLDR

Encode text to a QR code PNG
$ qrtool encode "[text]" -o [output.png]
copy
Encode text as terminal ASCII art
$ qrtool encode "[text]" -t ansi
copy
Decode a QR code from an image
$ qrtool decode [image.png]
copy
Encode as SVG with custom colors
$ qrtool encode "[text]" -t svg --foreground "#000000" --background "#ffffff" -o [output.svg]
copy
Generate a Micro QR code
$ qrtool encode "[text]" --variant micro -o [output.png]
copy
Read from stdin and output QR code
$ echo "[text]" | qrtool encode -o [output.png]
copy

SYNOPSIS

qrtool command [options]

DESCRIPTION

qrtool is a command-line utility for encoding text into QR codes and decoding QR codes from images. It supports multiple output formats including PNG, SVG, EPS, ANSI terminal art, and Unicode, plus QR code variants including standard, Micro QR, and rMQR. It reads from stdin and writes to stdout for Unix pipeline integration.

PARAMETERS

encode TEXT

Encode text into a QR code. Reads from stdin when TEXT is omitted.
decode FILE
Decode a QR code from an image file.
-t, --type FORMAT
Output format: png (default), svg, eps, pic, ansi, ascii, unicode, and color variants.
-o, --output FILE
Output file path (stdout if omitted).
-r, --read-from FILE
Read input data from a file instead of the command line.
--variant TYPE
QR code type: `normal` (default), `micro`, or `rmqr`.
--foreground COLOR
Foreground color in CSS format (default: black).
--background COLOR
Background color in CSS format (default: white).
-v, --symbol-version N
Symbol version: 1-40 for normal, 1-4 for micro. Auto-selected if omitted.
-l, --error-correction-level LEVEL
Error correction level: `l`, `m`, `q`, or `h`.
--mode MODE
Encoding mode: `numeric`, `alphanumeric`, `byte`, or `kanji`.
--mask N
Mask pattern 0-7. Auto-selected if omitted.
-s, --size N
Module size in pixels for raster/vector outputs.
-m, --margin N
Margin width in modules (default: 4 for normal, 2 for others).
--verbose
Print QR code metadata to stderr.

HISTORY

qrtool was created by sorairolake and is written in Rust.

SEE ALSO

qrc(1), qrencode(1), zbarimg(1)

Copied to clipboard
Kai