QR Code Generator Widget
Add a QR code generator to your website. Visitors paste a link or a few lines of text and get a scannable code straight away, with a choice of error-correction level and colours and a PNG or SVG download for print.
Live preview
Exactly what your visitors will seeUnder the widget on your page: Powered by A2Z Tools
Embed code
<iframe src="https://a2z.tools/embed/w/qr-code-generator" title="QR Code Generator by A2Z Tools" width="100%" height="620" style="border:0;width:100%" loading="lazy" allow="clipboard-write"></iframe>
A plain iframe. Works everywhere, including site builders that strip scripts. Adjust height if your content needs more room.
<div data-a2z-widget="qr-code-generator" data-height="620"></div> <script async src="https://a2z.tools/embed.js"></script>
Adds a small script (what it does) that sizes the widget to fit its content, loads it lazily and keeps it isolated from your page's CSS.
Works with
How it works
The widget encodes the text with the same QR library as the A2Z QR Code Generator page. Text is converted to UTF-8 bytes first, so accented letters, Indian scripts and emoji survive the trip to the phone; that is also why the byte count can be larger than the character count (é takes two bytes, ₹ three). Text made only of digits, or only of capitals, digits and a few symbols, is packed in the denser numeric or alphanumeric mode; everything else, including any lower-case link, uses byte mode. The encoder then picks the smallest of the 40 QR versions whose capacity at the chosen error-correction level holds the data. Capacity falls as correction rises: version 1 holds 17 bytes at L but only 7 at H, and the largest symbol, version 40 (177 x 177 modules), holds 2,953 bytes at L. Higher correction therefore makes a denser, larger code for the same link, in exchange for surviving scratches, dirt or a small logo sticker. The widget draws the code with the four-module quiet zone scanners expect, reports the byte count, version and module grid under the preview, warns about pale or inverted colours using the WCAG contrast ratio, and points out a bare domain such as example.com, which most phone cameras show as plain text rather than a link to open.
Method
- Encoding: ISO/IEC 18004 QR code, automatic version 1-40; mode numeric for digits only, alphanumeric for 0-9 A-Z space $ % * + - . / : only, otherwise byte mode with UTF-8 text
- Version = smallest v whose capacity in that mode at the chosen level holds the data; modules per side = 17 + 4v
- Byte-mode capacity (ISO/IEC 18004): v1 L17 M14 Q11 H7; v2 L32 M26 Q20 H14; v3 L53 M42 Q32 H24; v40 L2953
- Error correction: L restores about 7% of damaged codewords, M 15%, Q 25%, H 30%
- Quiet zone = 4 modules on every side
- Colour check: WCAG contrast ratio (L1 + 0.05) / (L2 + 0.05), shown to 1 decimal; warned below 4:1 or when the code is lighter than the background
Worked examples
A short link at the default level
Inputs: Text https://a2z.tools, error correction M, black on white
Result: 17 bytes - version 2 (25 x 25 modules), error correction M. No warnings.
Version 1 at level M holds 14 bytes, so the 17-byte link moves up to version 2. The same link at level H needs version 3 (29 x 29), because version 2-H holds only 14 bytes.
Accented text and a rupee sign
Inputs: Text Café ₹ menu, error correction M
Result: 14 bytes - version 1 (21 x 21 modules), error correction M.
11 characters become 14 UTF-8 bytes (é is 2 bytes, ₹ is 3), which exactly fills version 1-M; adding one more letter pushes the code to version 2.
A bare domain in pale grey
Inputs: Text example.com/menu, error correction Q, code #aaaaaa on #ffffff
Result: 16 bytes - version 2 (25 x 25 modules), error correction Q, with two warnings: low contrast (2.3:1) and add https:// in front
#aaaaaa has relative luminance 0.402, so the ratio is 1.05 / 0.452 = 2.3:1. Without a scheme, phones treat example.com/menu as text rather than a link.
Limitations
- Only static codes: the content is fixed inside the image, so there is no scan counting and a printed code cannot be redirected later.
- One mode is used for the whole text. Mixed content (for example a lower-case link followed by a long number) is not split into segments, and Kanji mode is never used, so some codes are a version larger than the minimum possible.
- The widget does not scan the result. Contrast, print size, quiet zone and the scanning app all affect readability, so test the printed code with a phone.
- Logos, rounded dots and other styling are not offered; they eat into error-correction capacity.
- Micro QR, rMQR and structured append (one message split over several codes) are not supported; input is capped at 2,953 characters, the byte-mode maximum of version 40-L.
Where publishers use it
- Restaurants and cafes letting staff make a table QR for the online menu without leaving the website
- Event organisers turning a registration link into a code for posters and slides
- Teachers and trainers sharing a worksheet or form link with a class
- Print shops and designers offering customers an SVG code that scales cleanly on banners
Questions
Do the QR codes expire?
No. The link or text is stored inside the code itself, so the code keeps working for as long as the link it points to works. Nothing is hosted or tracked by A2Z.
Which error-correction level should I choose?
M suits most uses. Choose Q or H if the code will be printed small, outdoors or where it may get scuffed; choose L only when you must fit a lot of text, because higher levels make the code denser.
Why does it warn about my colours?
Scanners look for dark modules on a light background. Light-on-dark (inverted) codes and pale colours with little contrast fail on many phones, so the widget warns before you print.
PNG or SVG?
Use PNG for documents, slides and websites. Use SVG for print and signage: it is a vector file that stays sharp at any size.
Sources
- ISO/IEC 18004:2024 - QR code bar code symbology specification - ISO/IEC JTC 1/SC 31 . versions 1-40, byte-mode capacities, error-correction levels L/M/Q/H and the 4-module quiet zone (paid standard; edition 4, 2024)
- Web Content Accessibility Guidelines (WCAG) 2.2 - contrast ratio - W3C . formula used for the colour warning; the 4:1 warning level is A2Z's own cautious threshold, not part of ISO/IEC 18004
Cite or recommend this tool
If you reference this tool in an article, course or documentation, these formats are ready to copy. They are optional - nothing is added to your site unless you paste it.
A2Z Tools QR Code Generator https://a2z.tools/qrcode-generator
<a href="https://a2z.tools/qrcode-generator">A2Z Tools QR Code Generator</a>
[A2Z Tools QR Code Generator](https://a2z.tools/qrcode-generator)
QR Code Generator by A2Z Tools - https://a2z.tools/qrcode-generator
Related widgets
-
A QR code guests scan to join your Wi-Fi without typing the password.
-
Put name, phone, email, website and address in a QR code that saves as a phone contact.
-
A UPI payment QR code for any UPI ID, with an optional fixed amount and note.
-
Strong random passwords from 8 to 128 characters, with the entropy of each shown in bits.
-
Fair random numbers in any range - whole or decimal, with or without repeats, sorted if you like.