Press "Enter" to skip to content

QR Code Generating with Vanilla JavaScript | qrjs2

Generate QR Code using Vanilla JS that allows you to create customizable QR codes using SVG, PNG, and HTML table elements.

javascript qr code generator with logo, qr code generator github, html qr code generator, qr code algorithm javascript, browser qr code generator, jquery qr code generator

How to make use of it:


$ npm install qrjs2

# Bower
$ bower install qrjs2

Insert the principle JavaScript file qrjs2.js into the doc and also you’re able to go.

<script src="qrjs2.js"></script>

Generate an SVG-based mostly QR code inside your div component.

var svgElement = document.createElement("div"),
u = "",
s = QRCode.generateSVG(u, {
    //options here

Generate an SVG  QR code with Data URIs and PNG fallback.

if (document.implementation.hasFeature("","1.1")) {
  var dataUriSvgImage = document.createElement("img"),
  u = "",
  s = QRCode.generateSVG(u, {
      // options here
  var XMLS = new XMLSerializer();
  s = XMLS.serializeToString(s);
  s = "data:image/svg+xml;base64," + window.btoa(unescape(encodeURIComponent(s)));
  dataUriSvgImage.src = s;
var dataUriPngImage = document.createElement("img"),
u = "",
s = QRCode.generatePNG(u, {
    // options here
dataUriPngImage.src = s;

Generate an HTML table-based QR code.

var htmlTable = document.createElement("div"),
u = "",
s = QRCode.generateHTML(u, {
    // options here

All default choices to customize the QR codes.

// 'L', 'M', 'Q' and 'H'
ecclevel: "M",

// fill color
fillcolor: "#FFFFFF",

// text color
textcolor: "#373737",

// margin size
margin: 4,

// module size
modulesize: 8

Customizable QR Code Generator, qrjs2 Plugin/Github, javascript qr code generator svg, jquery qr code generator codepen

See Demo And Download

Official Website(englishextra): Click Here

This superior jQuery/javascript plugin is developed by englishextra. For extra advanced usage, please go to the official website.

Be First to Comment

    Leave a Reply

    Your email address will not be published.