libusb/libusb logo

libusb/libusb

Free

A cross-platform library to access USB devices

FreeFree tier
Type
Open Source

About libusb/libusb

libusb is a cross-platform library that provides userspace access to USB devices on Linux, macOS, Windows, OpenBSD/NetBSD, Haiku, Solaris, and WebAssembly via WebUSB. Written in C (with a Haiku backend in C++), it is designed to be portable and abstracted for easy adaptation to other operating systems. The library is licensed under the GNU Lesser General Public License version 2.1 or later. Developers can consult the API documentation at api.libusb.info and use the mailing list for support. libusb is widely used for building applications that need to communicate directly with USB hardware without writing kernel drivers.

Key Features

Cross-platform USB device access from Linux, macOS, Windows, OpenBSD/NetBSD, Haiku, Solaris, and WebAssembly via WebUSB
Written in C (Haiku backend in C++)
Abstracted internals for easy porting to other operating systems
Licensed under LGPL-2.1 (or later)
Comprehensive API documentation available at api.libusb.info
Active mailing list for community support

Pros & Cons

Pros
  • Cross-platform support across major operating systems and WebAssembly
  • Open source with permissive LGPL license allowing commercial use
  • Long-standing stable project with large community (6.1k stars, 2.1k forks)
  • Well-documented API and active mailing list for support
  • Lightweight C library suitable for embedded and performance-sensitive applications
Cons
  • Low-level C API requiring understanding of USB protocol and device descriptors
  • No high-level abstractions for common USB device classes (e.g., HID, mass storage)
  • Platform-specific setup may be needed (e.g., permissions, driver installation)
  • Not a plug-and-play solution; users must write code to interact with devices

Best For

Developing userspace USB drivers and applications that communicate with USB devicesBuilding cross-platform software that requires low-level USB controlAccessing USB devices from web browsers via WebUSB with WebAssembly supportEmbedded systems and IoT devices that need host-side USB communicationTesting and debugging USB hardware without kernel-level programming

FAQ

What is libusb?
libusb is a cross-platform library that provides userspace access to USB devices. It allows applications to communicate with USB hardware without writing kernel drivers.
Which operating systems are supported?
libusb supports Linux, macOS, Windows, OpenBSD/NetBSD, Haiku, Solaris userspace, and WebAssembly via WebUSB.
What license is libusb released under?
libusb is licensed under the GNU Lesser General Public License version 2.1 or, at your option, any later version (LGPL-2.1+).
Where can I find the API documentation?
The API documentation is available at http://api.libusb.info.
How can I get help or ask questions?
Questions and discussions should be directed to the libusb mailing list at http://mailing-list.libusb.info.