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.
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.
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" }'
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.
See it in practice
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
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.
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.