Generate a QR Code in the Terminal With qrencode

Encode a URL or short text as a QR code drawn with ANSI blocks.

macOSnetworkTerminalLow risk
Run qrencode -t ANSIUTF8 to print a scannable QR code in the terminal.

01Command

Command
$ qrencode -t ANSIUTF8 "https://cmdcv.com"

02What it does

qrencode encodes data and can emit many formats; -t ANSIUTF8 draws the code with block characters so a phone camera can scan it straight off the screen. Use -o file.png to save a PNG instead, and -s to set the module size.

03Risk

RiskLow risk
Requirementsbrew install qrencode
CompatibilitymacOS with Homebrew installed
!Warning: Keep the terminal background dark and the text short; very long payloads produce dense codes that are hard to scan.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • qrencode
    Kentaro Fukuchi · vendor-doc · 2026-09-20
    Evidence: Official qrencode page documenting output types including ANSIUTF8.
  • Homebrew formula: qrencode
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Installs qrencode, a QR Code encoder with ANSI terminal output.

Last verified: 2026-09-20 · Category: Developer

06Related solutions