Skip to content

What is QMK firmware?

PCB and Firmware

QMK firmware is open-source keyboard firmware that runs on a keyboard's microcontroller, detects key presses and passes them to the computer. QMK stands for Quantum Mechanical Keyboard.

By Head Crusher GadgetPublished

  • QMK is open-source keyboard firmware under the GNU General Public License.
  • A QMK keymap holds up to 32 layers, indexed 0 to 31.
  • VIA configures QMK boards, Vial forks QMK, and ZMK is a separate firmware.
  • QMK documents Bluetooth for 2 modules and no NKRO on those chipsets.

In plain English: QMK is the program inside a mechanical keyboard that decides what each key does, and you edit it to remap keys.

QMK firmware QMK firmware is open-source keyboard firmware, named for Quantum Mechanical Keyboard, that runs on a keyboard's microcontroller and turns key presses into reports for the host computer.

What is QMK firmware?

QMK firmware is open-source keyboard firmware that runs on a keyboard’s microcontroller, detects key presses and passes them to the computer. QMK stands for Quantum Mechanical Keyboard.

The QMK glossary defines firmware as the software that controls your MCU, which is the microcontroller on the keyboard’s PCB. QMK describes itself as an open-source community that develops firmware for computer input devices, including keyboards, mice and MIDI devices. The project started as a heavily modified fork of TMK, according to QMK’s general FAQ.

The qmk/qmk_firmware repository describes the project as open-source keyboard firmware for Atmel AVR and Arm USB families, under the GPL-2.0 license. QMK’s keyboard guidelines state that the core is licensed under the GNU General Public License, with AVR binaries under GPLv2 or GPLv3 and ARM binaries under GPLv3. The sections below cover the keymap, the related firmware, the limits and the install routes, and the wider hub on mechanical keyboard PCBs and firmware places QMK among the other parts of a board.

How does QMK firmware work?

QMK stores a keymap as an array of layer arrays and checks the highest active layer first. QMK allows 32 layers, indexed 0 to 31.

A keymap is an array of keycodes mapped to a physical keyboard layout, and QMK processes it on key presses and releases. In the keymap.c file, a keymaps[] array holds the layers, and the LAYOUT() macro builds each layer. The higher active layer takes precedence over a lower one, according to QMK’s keymap overview.

Under the keymap sits the keyboard matrix, a pattern of rows and columns wiring that lets the controller detect presses with fewer pins. QMK’s matrix guide states that a diode lets current pass one way and prevents ghosting. The firmware family around QMK is the next question.

How do QMK, VIA, Vial and ZMK differ?

QMK is the base firmware. VIA keyboard configurator software edits QMK boards that have a VIA definition, Vial is a QMK fork with its own GUI, and ZMK keyboard firmware is a separate project on the Zephyr RTOS.

Four projects appear on spec sheets, and each project’s own documentation supplies the row in the table.

Firmware What it is Depends on QMK Wireless Source
QMK Open-source firmware, GPL, AVR and ARM chips Base project 2 Bluetooth modules on AVR-based chips QMK
VIA Configurator that needs a keyboard definition Yes, official support needs the board’s implementation in QMK Firmware Not published VIA
Vial Open-source cross-platform GUI described as a QMK fork Forks QMK Not published Vial
ZMK Open-source (MIT) firmware on the Zephyr RTOS No, separate project Low-latency BLE, multi-device BLE, USB, wireless split keyboards ZMK

VIA’s site claims compatibility with 1400+ keyboards. Vial configures the keyboard in real time, according to its project page. The table shows one dependency chain and one separate project: VIA needs QMK, Vial forks QMK, and ZMK stands alone. Rollover and connectivity are the next two hardware attributes.

Does QMK support NKRO?

Yes. QMK supports N-key rollover through the NKRO_ENABLE build option, and the Magic N command switches between NKRO and 6KRO. BIOS needs 6KRO mode.

The QMK glossary defines NKRO as keyboards capable of reporting any number of key presses at once. QMK’s miscellaneous FAQ states that the BIOS needs 6KRO mode, so a board set to NKRO switches to 6KRO for BIOS use. The supported Bluetooth chipsets are the exception, because they do not support NKRO.

Does QMK support Bluetooth and wireless?

QMK documents Bluetooth support for 2 modules on AVR-based chips. ZMK lists low-latency BLE and wireless split support, and makers such as Keychron publish their own QMK repositories.

QMK’s wireless page lists the RN-42 module for Bluetooth 2.1 and the Adafruit Bluefruit SPI Friend module for BLE. QMK states that Bluetooth support covers AVR-based chips only, that the supported chipsets do not support NKRO, and that BLE is needed for iOS.

Keychron publishes a repository of 63 boards, forked from qmk/qmk_firmware. Because makers fork the project, the firmware on your board follows the maker’s repository, so check the maker’s firmware page for the board you own.

How do you install QMK firmware?

There are 3 routes to QMK firmware, per its docs: the online Configurator, the command line build, and flashing the built file in bootloader mode.

These steps come from QMK’s documentation, and Head Crusher Gadget has not performed them. The routes run in this order:

  1. Use the QMK Configurator, an online GUI that generates .hex or .bin firmware files and works best in Chrome or Firefox. QMK states that the Configurator does not build for a different controller than the one the board was designed for, and that KLE and kbfirmware files do not import.
  2. Use the command line. On Windows, QMK points to the QMK MSYS bundle. Run qmk setup, then qmk compile -kb followed by the keyboard name and -km default.
  3. Flash the built file. Enter bootloader mode, then flash with QMK Toolbox on Windows or macOS, or with qmk flash.

QMK’s flashing guide cautions you not to unplug the keyboard or interrupt the flash. Whether your board runs QMK at all comes last.

Does your keyboard run QMK?

Check the maker’s spec for QMK, VIA or Vial. Hot-swap sockets describe switches, not firmware, and Keychron lists hot-swap and QMK as separate attributes for the Q1 Max.

A buildable QMK keyboard needs a keyboard.json file, according to QMK’s keyboard guidelines. Run three checks before you assume a board runs QMK:

  • Read the spec sheet for the words QMK, VIA or Vial.
  • Look for the board in the maker’s firmware repository.
  • Treat hot-swap as a switch feature, never as proof of QMK.

The guide to hot-swap keyboards explains the socket side, and the guide on how to choose a mechanical keyboard continues the buying process.

Questions and answers

Each question below has a short, direct answer you can read on its own.

What is QMK used for?

QMK defines what each key does. Its docs describe a keymap as an array of keycodes mapped to the physical layout, with up to 32 layers. Users edit the keymap to remap keys, add layers and set features, then build and flash the result to the keyboard.

Is QMK the same as VIA?

No. VIA is a configurator that needs a keyboard definition, and its specification states official support requires the keyboard implementation to exist in QMK Firmware. QMK is the firmware, and VIA is a tool that edits the keymap on VIA-enabled QMK boards.

What is the difference between QMK and ZMK?

QMK documents support for AVR and ARM chips and lists 2 Bluetooth modules. ZMK is open source under the MIT license, runs on the Zephyr RTOS and lists low-latency BLE, multi-device BLE, USB and wireless split support. The two are separate projects.

What is the layer limit in QMK?

QMK's keymap documentation states layers are indexed 0 to 31, a limit of 32 layers per keymap. The firmware checks the highest active layer first, so a higher layer takes precedence over a lower one when both layers define a key.

Is QMK free to use?

Yes. The QMK repository shows the GPL-2.0 license, and the keyboard guidelines state the core is licensed under the GNU General Public License. AVR binaries use either GPLv2 or GPLv3, and ARM binaries use GPLv3 because of the ChibiOS license.

Head Crusher Gadget