# QR code generator

Make a scannable QR code as SVG from any text or link, with a choice of size, colours and error correction.

A complete QR encoder (byte mode, UTF-8, versions 1 to 40) that picks the smallest version that fits, tries all eight masks and reads every code back before returning it.

- Endpoint: `POST https://setget.net/v1/tools/qr-generate` with JSON `{"input": {...}}`
- MCP: `run_tool` with `slug` = `qr-generate`
- Page: https://setget.net/tools/qr-generate

## Inputs

- `text` (required, string): The text or link to store in the code.
- `error_correction` (optional, string, one of `L`, `M`, `Q`, `H`, default `"M"`): How much damage the code survives: L about 7%, M 15%, Q 25%, H 30%. Higher levels hold less.
- `module_size` (optional, integer, default `8`, range 1..40): Width of one small square (module) in pixels.
- `margin` (optional, integer, default `4`, range 0..20): Blank quiet zone around the code, in modules. Scanners expect at least 4.
- `foreground` (optional, string, default `"#000000"`): Colour of the dark squares: hex such as #000000, or a basic colour name.
- `background` (optional, string, default `"#ffffff"`): Colour behind the code: hex, a basic colour name, or "transparent".

## Example 1: A link

```json
{"input":{"text":"https://setget.net"}}
```

## Example 2: High error correction in dark blue

```json
{"input":{"text":"Table 12","error_correction":"H","foreground":"#1e3a8a","module_size":6}}
```

**How much text fits?** Up to 2,953 bytes at level L and 1,273 at level H. Short content gives a simpler code that scans faster, so prefer a short link.

**Does the code expire or track scans?** No. The text is stored in the picture itself. Nothing is redirected or counted.

**Why will my code not scan?** Keep strong contrast (dark squares on a light background), leave the margin at 4 or more, and print it large enough: about 2 cm across for a short link. Long text makes dense codes that need more size.
