Guide

How to Generate a QR Code from Text or a URL

Enter nonempty text or a URL, choose optional size, correction, and color settings, then generate the image. A successful result is a base64-encoded PNG.

Tool QR Code Generator

What the QR Code Generator does

This QR Code Generator turns supplied text or a URL into a QR-code image when the content is nonempty. You can provide the value through the main content input or through a text, URL, or content alias. It is useful for sharing a website address, contact instruction, short message, or other text that people can scan.

A successful result is returned as a base64-encoded PNG. The tool does not generate an image when the content is empty, so checking the input before generating is important.

How to generate a QR code

  1. Enter the text or URL you want to encode. Use the primary content field, or provide the value through a supported text, URL, or content alias. Make sure the value is not empty.

  2. Choose an image size if the default is not suitable. If you do not provide a size, it defaults to 256. Supplied sizes are converted to integers when possible, then limited to the range 64 through 1024. A value that cannot be converted falls back to 256. Because the QR module scale is calculated as an integer, the final PNG dimensions can differ from the normalized requested size.

  3. Select an error-correction level when needed. The accepted levels are L, M, Q, and H. If you use a lowercase value, it is normalized to uppercase. An unsupported value uses M instead. If you do not specify a level, M is the default.

  4. Set the foreground and background colors if you need a different appearance. The defaults are black foreground and white background.

  5. Generate the QR code and inspect the returned result. A successful generation produces a nonempty base64 string representing a PNG image. Keep the original text or URL available so you can compare it with what you intended to encode.

How to interpret the result

A nonempty result indicates that the tool generated an image in PNG format and represented it as base64 text. The base64 value is an encoded form of the image data, not the QR image displayed as ordinary text. The output is therefore suitable for a workflow that expects a base64-encoded PNG.

An empty result does not provide an image to use. Empty content causes the generation process to return without creating one, and generation or dependency failures may also produce no image. If you supplied a size, remember that the requested value is normalized and used to calculate the QR module scale, so the resulting pixel dimensions may not match that value exactly.

The correction setting and colors affect generation options, but the available behavior does not establish decoding accuracy, standards compliance, or a guaranteed result for every possible input. Treat the generated PNG as the output to inspect before using it in a document, label, or other project.

Worked example

A restaurant wants a QR code that points customers to its online menu.

Enter the restaurant menu URL as nonempty content, leave the size and correction settings at their defaults, and generate the image.

With the defaults left in place, the resolved size is 256 and the resolved error-correction level is M, so a successful result has a nonempty base64 string that decodes to a valid PNG image with black foreground on a white background.

Limitations

  • Empty content produces no image, and generation or dependency failures may also produce no image. Successful output is PNG; the available behavior does not establish decoding accuracy or standards compliance.

Common errors

  • If the content field is left blank, the default input is empty and no image is generated. Enter nonempty text or a URL before generating.

FAQ

What does the QR Code Generator return?

When the supplied content is nonempty, the tool generates a QR-code image and returns it as a base64-encoded PNG. Empty content returns no image.

What image size should I use?

When no size is supplied, the default is 256. Supplied values are converted to integers when possible and limited to 64 through 1024; the final PNG dimensions may differ because the QR module scale is calculated as an integer.

Which error-correction levels are accepted?

When no correction level is supplied, M is used. The accepted levels are L, M, Q, and H, and unsupported values fall back to M after normalization.

Tool

QR Code Generator