Generate a QR Code in the Terminal With qrencode
Encode a URL or short text as a QR code drawn with ANSI blocks.
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
!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
- qrencodeEvidence: Official qrencode page documenting output types including ANSIUTF8.
- Homebrew formula: qrencodeEvidence: Installs qrencode, a QR Code encoder with ANSI terminal output.
Last verified: 2026-09-20 · Category: Developer
06Related solutions
Change where screenshots are saved on Mac
Point macOS screen captures at any folder you choose instead of the desktop.
Download a file from a URL on Mac with curl
Grab any file from the web straight into the current folder — no browser needed.
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.