
QRCode.js
A small JavaScript library that draws QR codes in a web page, with no dependencies.
- Stars
- 14.3k
- Forks
- 4.7k
- Licence
- MIT
- Language
- JavaScript
- Last update
- 2.5 years ago
- Type
- Library
No commits in over a year — check for forks or alternatives before adopting.
What it is
QRCode.js is a JavaScript library that generates QR codes inside a web page. You give it some text or a link and a container element, and it draws the code using HTML5 Canvas or a table in the DOM. The README says it has no dependencies and lists a wide range of browsers, including old Internet Explorer versions.
- Display a QR code linking to a web page on a product or event page
- Generate a code with custom width, height, and dark and light colors
- Replace the displayed code by calling makeCode with new text
- Clear a displayed code with the clear method
Great for
- Web developers who want to show a QR code for a URL on a page
- Developers maintaining sites that must support older browsers
- Projects that want to avoid adding extra libraries
Not ideal for
- People who want a ready-made QR code tool without writing code, since this is a library for developers
- Teams needing actively maintained support, because the README gives no recent version and the last push shown is from May 2024
- Use cases needing a server-side or command-line generator, since the README only describes browser usage
How to get it
- 1
See the README
Clone the repository
git clone https://github.com/davidshimjs/qrcodejs - 2
Run it
- Clone the repository or download the library file.
- Add a container element to your HTML page with an id, such as a div.
- Include the script in a script tag on the page.
- Call new QRCode with the container element and your text to draw the code.
- 3
Get the most out of it
- Set correctLevel to QRCode.CorrectLevel.H for higher error correction, as shown in the README example
- Adjust width, height, colorDark, and colorLight to fit your design
- Use makeCode to update the same code for new text without creating a new instance
- Use clear to remove the current code from the container
Downloads
Strengths
- The README says it has no dependencies
- It works in browsers using either Canvas or table markup
- It is MIT licensed and has a large star count (14,320)
Trade-offs
- The README gives no install instructions, version number, or release history
- The last push shown is 2024-05-01, so upkeep status is unclear
- The README is brief and does not document every option
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.