QR Code Generator

Generate a QR code from text, URL, or any payload. Pick foreground colour, background colour (or transparent), error correction level, margin and size. Returns SVG, base64 data URL, and ASCII preview.

DomainGeneral UtilityVersionv1.0.0Added2026-05-17

Turn any text, URL or payload into a QR code with full control over colour, background, error correction and size. It outputs crisp vector SVG (which scales to any print size without blurring), a base64 data URL you can drop straight into HTML, and an ASCII preview — all generated in your browser, nothing uploaded.

Inputs
Content
Anything you want to encode. URLs, plain text, Wi-Fi credentials, vCards, UPI strings.
Error Correction
L ≈ 7% recovery · M ≈ 15% · Q ≈ 25% · H ≈ 30%. Higher = more robust but bigger QR. Use H for logos overlaid on the code.
Foreground Colour
Hex (#000000), rgb(), or any CSS named colour. The dark modules of the QR.
Background Colour
Hex, CSS colour, or the literal word "transparent" for no fill.
Quiet Zonemodules
Empty border in QR modules. Standard is 4. Set 0 for edge-to-edge.
Sizepx
Output Format
svg = vector, infinite scaling, tiny file. png = lossless raster with transparency. jpeg = smaller, no transparency. webp = modern, smaller than png.
Result
version1.0.0
POST /v1/general-utility/qr-code-generatorView API docs →
curl -X POST https://toolsamurai.com/api/v1/general-utility/qr-code-generator \
  -H "Authorization: Bearer sk_live_•••••••••••••••" \
  -H "Content-Type: application/json" \
  -d '{
     "content": "https://toolsamurai.com",
     "error_correction": "M",
     "foreground": "#0c0c0d",
     "background": "#ffffff",
     "margin": 4,
     "size": 512,
     "format": "svg"
  }'
qr-codeqrbarcodegeneratorsvgutility
How it works

The method behind the numbers

The encoder packs your content into the smallest QR version (grid size) that fits, then adds error-correction codewords using Reed–Solomon coding. The error-correction level you pick trades capacity for resilience: level L recovers about 7% of a damaged code, M about 15%, Q about 25%, and H about 30%. Higher levels survive scuffs, logos and print bleed but need a denser grid for the same data.

The margin (quiet zone) is the blank border scanners rely on to locate the code — four modules is the spec minimum, and dropping it too low hurts scan reliability. SVG output is resolution-independent, so it's the right choice for print and large displays; the data URL and raster formats suit quick embedding on the web.

Worked examples

See it in practice

A high-resilience URL code

Level H error correction so a logo or print wear won't break it.

content
https://toolsamurai.com
error_correction
H
foreground
#0c0c0d
background
#ffffff
margin
4
size
512
format
svg
FAQ

Frequently asked questions

Which error-correction level should I use?

Use M for general on-screen and clean print use. Step up to Q or H if the code will be small, printed on a rough surface, or have a logo overlaid — higher correction tolerates more damage at the cost of a denser grid.

Why use SVG instead of PNG?

SVG is vector, so it stays razor-sharp at any size — ideal for posters, packaging or business cards. PNG/JPEG are fine for fixed-size web use, but enlarging a raster QR introduces blur that can hurt scanning.

Can I make the background transparent?

Yes — set the background to transparent and the code will sit on whatever's behind it. Just keep enough contrast: dark modules on a light area scan best, and very low contrast (or a busy background) will fail to scan.

Is there a limit to how much I can encode?

QR codes top out around a few thousand characters, but practically you want to keep payloads short — more data means a denser grid that's harder to scan. For long URLs, a link shortener keeps the code clean and reliable.

Embedding

Embed QR Code Generator on your site

Sign in to configure the live preview, theme, defaults, locked inputs, and analytics ID from the embed dashboard.