StealThis .dev

QR Code

In-browser QR code generator — type a URL or text and get an instant scannable QR code with a download button.

Open in Lab
canvas vanilla-js
Targets: JS HTML

Code

QR Code Generator

Generates a scannable QR code from any URL or text string using a resilient multi-provider image strategy.

Features

  • Instant preview — QR code updates as you type (debounced)
  • Download — saves the image as qr-code.png
  • Error handling — shows a friendly message if the API is unavailable
  • Copy URL — copies the shareable QR image URL to the clipboard

Implementation

Tries multiple QR endpoints in sequence (chart.googleapis.com, api.qrserver.com, quickchart.io) and renders the first successful response as a PNG image. Download is triggered through a temporary <a> element, which avoids CORS-related fetch failures in browser sandboxes.