Scan with your phone. Type on your computer.

Point your phone's camera at a barcode and it's typed into whatever is open on your computer, just like a USB scanner. Add Tab, Enter or any shortcut after each scan.

npx barbarcode

Needs Node.js 22 or newer. No app on the phone, no account.

Stock count
SKUQty
Each scan types 4006381333931 Tab 1 Enter

How it works

  1. Run it on your computer

    Run npx barbarcode in a terminal. A QR code appears.

  2. Scan the QR code with your phone

    The scanner opens in your phone's browser. No app to install.

  3. Point it at barcodes

    Each code is typed wherever your cursor is: a spreadsheet, a form, a point-of-sale screen.

Choose what happens after each scan

Save keystroke profiles in barbarcode.toml (run npx barbarcode init for an example), then start with npx barbarcode -s price_check. You can switch profiles from the phone while you scan.

ProfilePatternTypes
inventory {barcode}{enter} 4006381333931 Enter
price_check {f4}{barcode}{enter} F4 4006381333931 Enter
data_entry SKU:{barcode}{tab}Quantity: SKU:4006381333931 Tab Quantity:
search {cmd+k}{delay:150}{barcode}{enter} ⌘ K wait 150 ms 4006381333931 Enter

Also: {tab}, {esc}, arrow keys, {f1} to {f24}, and any shortcut like {ctrl+s}. The barcode itself is always typed as plain text, so a barcode can never trigger a shortcut.

Works on any network

Phone browsers only allow the camera on secure (HTTPS) pages, so barbarcode gives your phone a secure address to reach your computer. The default works anywhere; the others keep everything on infrastructure you choose.

CommandHow it connectsYou'll need
npx barbarcode Through the barbarcode relay, from any network Nothing
--via cloudflare A temporary Cloudflare tunnel that you run cloudflared, no account
--via tailscale Your tailnet, so only your own devices can connect Tailscale with HTTPS turned on

Scans are end-to-end encrypted. The key exists only in the QR code, so neither the relay nor a tunnel can read your scans or type on your computer.

Types on macOS, Windows and Linux

macOS
Allow your terminal app once in System Settings, under Privacy & Security, Accessibility.
Windows
Works out of the box.
Linux
Install xdotool (X11) or wtype (Wayland).