---
title: ToolRouter — Tool Detail
description: Detailed documentation for a ToolRouter tool including skills, parameters, and examples.
url: https://toolrouter.com/tools/qr-code-generator
---
# QR Code Generator

Generate scannable QR codes for URLs, text, WiFi credentials, or contact cards. Outputs permanent image URLs in PNG, SVG, JPG, or GIF with control over size, colors, error correction, and margins. Ideal for marketing materials, events, and business cards.

- **Version:** 0.02
- **Categories:** productivity, media

## Skills (3)

### Generate QR Code (`generate_qr`)

Generate a QR code from any text or URL. Returns a permanent image URL and downloadable file. Supports custom size, colors, format (PNG/SVG/JPG/GIF), and error correction level.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `data` | string | Yes | The content to encode in the QR code — a URL, plain text, email address, phone number, or any string up to ~900 characters |
| `size` | number | No | QR code image size in pixels (10–1000, default 300). The image is always square. [default: 300] |
| `format` | string | No | Output image format (default "png"). Use "svg" for scalable vector output. (png, svg, jpg, gif) [default: "png"] |
| `ecc` | string | No | Error correction level: L (~7%), M (~15%), Q (~25%), H (~30%). Higher = more resilient but denser. Default "M". (L, M, Q, H) [default: "M"] |
| `color` | string | No | QR code foreground color as hex (e.g. "#000000", "FF0000"). Default is black. |
| `bgcolor` | string | No | Background color as hex (e.g. "#FFFFFF", "FFF"). Default is white. |
| `margin` | number | No | Quiet zone margin in pixels (0–50). Default 1. |

**Returns:** QR code image URL (permanent), downloadable image via asset system, image dimensions, and encoded data length

**Examples:**

*QR code for a URL:*

```json
{
  "data": "https://toolrouter.com"
}
```

*Large SVG QR code with custom colors:*

```json
{
  "data": "https://github.com/public-apis/public-apis",
  "size": 500,
  "format": "svg",
  "color": "#1a1a2e",
  "bgcolor": "#e8e8e8",
  "ecc": "H"
}
```

*QR code for plain text:*

```json
{
  "data": "Hello, scan this QR code to read a message!"
}
```

### Generate WiFi QR Code (`generate_wifi_qr`)

Generate a QR code that lets people connect to a WiFi network by scanning. Encodes SSID, password, and encryption type in the standard WiFi QR format. Scanning auto-connects on most phones.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `ssid` | string | Yes | The WiFi network name (SSID) |
| `password` | string | No | The WiFi password. Omit for open networks. |
| `encryption` | string | No | Encryption type: "WPA" (WPA/WPA2/WPA3), "WEP" (legacy), "nopass" (open). Auto-detects based on password presence. (WPA, WEP, nopass) [default: "WPA"] |
| `hidden` | boolean | No | Whether the network is hidden (not broadcasting SSID). Default false. [default: false] |
| `size` | number | No | QR code image size in pixels (default 300) [default: 300] |
| `format` | string | No | Output image format (default "png") (png, svg, jpg, gif) [default: "png"] |
| `ecc` | string | No | Error correction level (default "H" for WiFi QR — higher resilience when printed) (L, M, Q, H) [default: "H"] |
| `color` | string | No | QR code foreground color as hex |
| `bgcolor` | string | No | Background color as hex |

**Returns:** WiFi QR code image URL, downloadable image, network details (SSID, encryption, hidden status)

**Examples:**

*WiFi QR for a WPA2 network:*

```json
{
  "ssid": "MyHomeWifi",
  "password": "supersecret123"
}
```

*WiFi QR for an open guest network:*

```json
{
  "ssid": "CoffeeShop_Guest",
  "encryption": "nopass"
}
```

### Generate Contact QR Code (`generate_vcard_qr`)

Generate a QR code containing a vCard contact card. When scanned, the contact is automatically added to the phone's address book. Supports name, phone, email, organization, title, URL, and address.

**Parameters:**

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `first_name` | string | Yes | Contact first name (required) |
| `last_name` | string | No | Contact last name |
| `phone` | string | No | Phone number (e.g. "+1-555-123-4567") |
| `email` | string | No | Email address |
| `organization` | string | No | Company or organization name |
| `title` | string | No | Job title or role |
| `url` | string | No | Website URL |
| `address` | string | No | Street address |
| `note` | string | No | Additional notes about the contact |
| `size` | number | No | QR code image size in pixels (default 300) [default: 300] |
| `format` | string | No | Output image format (default "png") (png, svg, jpg, gif) [default: "png"] |
| `ecc` | string | No | Error correction level (default "M") (L, M, Q, H) [default: "M"] |
| `color` | string | No | QR code foreground color as hex |
| `bgcolor` | string | No | Background color as hex |

**Returns:** Contact vCard QR code image URL, downloadable image, contact name, and list of included fields

**Examples:**

*Business card QR with full contact details:*

```json
{
  "first_name": "Jane",
  "last_name": "Smith",
  "phone": "+1-555-123-4567",
  "email": "jane@example.com",
  "organization": "Acme Corp",
  "title": "CTO",
  "url": "https://acme.com"
}
```

*Simple contact QR with just name and phone:*

```json
{
  "first_name": "John",
  "phone": "+44-20-1234-5678"
}
```

## Quick Start

```bash
# Via CLI
TOOLROUTER_API_KEY=tr_live_xxx npx -y toolrouter-mcp call qr-code-generator generate_qr --data https://toolrouter.com

# Via REST API
curl -H "Authorization: Bearer tr_live_xxx" \
     -d '{"tool":"qr-code-generator","skill":"generate_qr","input":{"data":"https://toolrouter.com"}}' \
     https://api.toolrouter.com/v1/tools/call
```

## Frequently Asked Questions

### Which QR format should I use for print versus web?

Use `svg` when you need clean print output that can scale without blurring. Use `png`, `jpg`, or `gif` for web previews, social posts, or quick downloads.

### Can I make a QR code for WiFi or a contact card?

Yes. The tool has dedicated WiFi and vCard flows, so you can share a network login or create a scannable contact card that adds the person to a phone address book.

### How much design control do I get over the QR code?

You can change size, foreground and background colors, margins, and error correction. Higher error correction is useful when the code will be printed or placed near a logo.

### What should I put in the data field?

Any URL, plain text, email address, phone number, or similar string works. The main generator handles most cases, while the WiFi and contact options are better for those specific formats.

---

## Get Started with ToolRouter

**Already connected?** Call any tool with `use_tool({ tool, skill, input })`. Browse tools with `discover` or visit https://toolrouter.com/llms-full.txt

**New to ToolRouter?** Connect with one command (no API key needed — auto-provisions on first use):

```bash
# MCP (Claude Code, Codex CLI)
claude mcp add toolrouter -- npx -y toolrouter-mcp

# MCP (Cursor, Windsurf, Cline, VS Code, Gemini CLI, Claude Desktop)
{"mcpServers":{"toolrouter":{"command":"npx","args":["-y","toolrouter-mcp"]}}}

# Claude Chat / Claude Cowork / Claude Mobile — add as a connector:
# Settings → Connectors → Add custom connector → URL: https://api.toolrouter.com/mcp

# ChatGPT — add as an app:
# Settings → Apps → Advanced settings → enable Developer mode → Create app → MCP Server URL: https://api.toolrouter.com/mcp

# CLI (works instantly, no restart needed)
npx -y toolrouter-mcp tools                    # browse all tools
npx -y toolrouter-mcp search "seo"             # search by keyword
npx -y toolrouter-mcp call seo analyze_page --url https://example.com
```

Free tools work immediately. For paid tools, visit https://toolrouter.com/claim to add credits.

All platforms: https://toolrouter.com/connect | Full catalog: https://toolrouter.com/llms-full.txt | Docs: https://toolrouter.com/docs