A technician holds a circuit board over a tray of components near a server rack
Software Licensing
William  

GPL or LGPL? Choosing the Right License for Your Code

LGPL vs GPL comes down to one hard choice: choose the GPL when every derivative work must remain under strong copyleft, and choose the LGPL when proprietary applications need to link to your library. The LGPL is the narrower, more permissive exception. It is not a safer GPL, and it does not erase your source, notice, or relinking duties.

Last updated: 2026-11-03

LGPL is GPL with one deliberate escape hatch, and that hatch is the whole argument. Under the GNU Lesser General Public License you can link a closed-source program against the library and keep your own code private, as long as the library stays swappable and its source stays available. The plain GNU General Public License grants no such exception for covered derivative works.

Table of Contents Toggle What the LGPL actually is How does LGPL differ from GPL? Why the linking method decides your obligations Can you keep your application proprietary under LGPL?

LGPL vs GPL at a glance

The GPL applies strong copyleft to the covered work and its derivative works. If you distribute a combined work that falls under the GPL's requirements, the entire work, as a whole, must be licensed under the GPL.

The LGPL keeps that obligation focused on the library. An application can link to an LGPL library and remain under its own license, including a proprietary license, if the LGPL conditions are met.

IssueGPLLGPL
Main purposeKeep covered programs and derivative works under strong copyleftKeep a reusable library free while allowing broader linking
Can proprietary code link to it?Usually no, if the result is a covered derivative workYes, under defined conditions
Must the application source be released?Usually yes when the distributed result is a covered derivative workNo, if the application remains separate and the conditions are met
Must changes to the covered code be shared?Yes, when distributing the covered workYes, when distributing changes to the LGPL library
Static linkingUsually brings the combined work under GPL obligationsPermitted, but users need a way to relink with a modified library
Dynamic linkingDoes not avoid GPL obligations for a covered combined workUsually the cleanest compliance route
Best fitAuthors demanding downstream copyleftLibrary authors seeking use in both free and proprietary software

The GPL's own terms say they apply to the whole work and all its parts, regardless of how those parts are packaged. However, inclusion of a covered work in an aggregate does not cause the GPL to apply to the other independent parts of that aggregate.

That distinction matters. A separate program stored beside a GPL program is not automatically GPL software. A program combined with GPL-covered code can be a different case.

What the GNU Lesser General Public License is

The GNU Lesser General Public License, or LGPL, is a free software license from the Free Software Foundation. The LGPL is primarily applied to libraries.

The GNU licenses are intended to guarantee your freedom to share and change free software so the software remains free for its users. The LGPL does that for the library while giving applications more room to use it under different terms.

In practice the LGPL is almost always used for software libraries rather than applications. A library author chooses it when adoption matters and proprietary developers are part of the intended audience.

The name changed over time. When the first version was released in 1991, GNU LGPL stood for GNU Library General Public License. The Free Software Foundation later changed “Library” to “Lesser” because the license provides less copyleft than the full GPL.

You may also see “lesser GNU public license” or “GNU LGPL license.” Those phrases usually point to the same license family, but the formal name is the GNU Lesser General Public License.

The exact version still matters. LGPL 2.1 and LGPL 3.0 do not have identical terms. LGPLv3 is written as an addendum to the GPL rather than as a self-contained license, so it is shorter than LGPLv2.1.

For version 3, the formal names include GNU Lesser General Public License v3.0 and GNU Lesser General Public License v3.0 or later. The identifier LGPL-3.0-only means version 3.0 only. The older LGPL-3.0+ identifier is deprecated; LGPL-3.0-or-later is the preferred identifier for version 3.0 or any later version.

The GNU Lesser General Public License Version 3 was published on 29 June 2007. Do not copy a license header from a random repository and assume it answers the version question. Read the license file that ships with the code.

How does lgpl vs gpl differ?

The GPL forces the covered derivative work to remain under the GPL. The LGPL confines that stronger copyleft to the library and permits a separate application to use the library under different terms.

That is the whole split. The rest is compliance detail.

Under the GPL, derived software must be licensed under the GPL when you distribute it as a covered derivative work. If you use a GPL library in a project in a way that creates a non-trivial combined work, the resulting software cannot keep its original proprietary license.

Under the LGPL, your application can remain closed if it uses the library without turning the application into a modified version of the library. You still need to provide the library's source, preserve notices, and keep the library replaceable.

A modified LGPL library remains under LGPL terms when you distribute it. Your application does not become LGPL merely because it calls the library.

The LGPL has a smaller copyleft scope, but the requirements are not cosmetic. The LGPL imposes requirements on a larger program that uses LGPL code. Those requirements are smaller than the GPL's requirements in the same situation, but they are real.

LGPL vs GPL obligations that actually differ

The license choice affects more than whether your source code stays private. Check each duty against the software you distribute.

Redistribution

The GPL requires the covered work and its derivative works to follow GPL conditions. The entire work, as a whole, must be licensed under the GPL when the license requires that result.

The LGPL lets a separate application use the library under another license. The library itself remains under the LGPL, and the application must preserve the conditions that let users replace or modify the library.

Source-code access

GPL distribution generally requires corresponding source for the covered work. That includes the source needed to build and modify the distributed program.

LGPL distribution requires the complete source code corresponding to the binary library. If you changed the library, those changes belong in the disclosed source.

The application source does not become part of the LGPL source obligation merely because it links to the library.

Modification

GPL changes to covered code stay under GPL terms when distributed. The same basic rule applies to changes you distribute to an LGPL library.

The important boundary is the thing you changed. Modifying the library triggers library obligations. Merely calling the library from your own application does not make your application a modified LGPL library.

Notices

Keep copyright and license notices intact. Include the license text and identify the LGPL-covered component in your distribution materials.

For LGPL-2.1 distribution, the notice obligation includes generating an open source notice and including it when redistributing the binary. A notice buried in an unused source directory is not a reliable distribution notice.

Compatibility

LGPL code can flow into a GPL project. The combined work can carry GPL terms, and the LGPL includes a path for using the ordinary GPL under its stated conditions.

The reverse does not work. You cannot take GPL code into an LGPL library and keep the resulting library under plain LGPL terms. GPL copyleft does not become weaker because the surrounding project prefers it.

Version compatibility also matters. Check whether the code says GPL version 2 only, GPL version 3 or later, LGPL version 2.1, or another combination. “It is all GNU licensing” is not a compatibility analysis.

Read the FSF position on linking and derivative works

The Free Software Foundation treats linking as part of the derivative-work question. The label “dynamic” or “static” does not settle every case by itself.

A program that links to a GPL library can create a covered combined work. The GPL's intended effect is that distributing that combined work brings the GPL's corresponding source and licensing duties with it.

The LGPL includes a deliberate exception for applications that use the library without becoming a modified version of the library. That exception is why normal application code can remain under a proprietary license.

The static-linking question has a practical answer under the LGPL. For compliance with the LGPL, provide access to the larger binary object file so a user may relink the application with a possibly modified LGPL library.

The obvious way to comply with the LGPL is to link the LGPL libraries dynamically, even if everything else is linked statically. Dynamic linking keeps the library as a separate shared object that users can replace.

Do not treat this as a license-free zone. Dynamic linking reduces the relinking problem, but it does not remove source, notice, copyright, or license-text duties.

A legal analysis can depend on the exact license version, the code relationship, and the distribution terms. Read the license text and get qualified legal advice for a commercial dispute. A forum answer is not a substitute for either.

What the LGPL allows proprietary applications to do

A man connecting colorful Ethernet cables into small metal servers on a wooden table

You can distribute a closed-source commercial application that links to an LGPL library. Your application code can stay under a proprietary license if the library remains a separate, replaceable component and you follow the LGPL conditions.

That is the point of the license. A library that only works inside GPL software reaches fewer commercial products. An LGPL library can be used by both free software and proprietary applications.

You still have to:

  • identify the LGPL library and preserve its notices;
  • provide the applicable LGPL license text;
  • provide the complete corresponding source for the library;
  • provide source for changes you made to the library;
  • allow users to replace or modify the library;
  • provide object files or another relinking method when static linking requires it;
  • avoid technical restrictions that stop users from exercising those rights.

For LGPL-2.1, provide a build environment that allows users to build an identical library from the disclosed source code of the LGPL library. The build materials must be usable, not a ceremonial source archive missing the generated files or build instructions.

Your application source is a different matter. The LGPL does not require you to publish it solely because the application links to the library.

What changes when you modify an LGPL library

Using an LGPL library and modifying an LGPL library are separate events. Developers often merge them into one vague rule and then miss the obligation that matters.

If you only call the library from your application, the application can remain proprietary under the LGPL conditions. If you patch the library and distribute that patched library, the changes must be released under LGPL terms.

The change does not need to be large. “We only changed one function” does not create an exemption.

When you distribute the modified library, provide:

  • the complete corresponding source code;
  • the license and copyright notices;
  • a clear description of your changes where the applicable version requires it;
  • the build materials needed to produce the library;
  • the relinking path required by the LGPL for the way you distributed it.

Keep your application code separate where possible. A clean library boundary makes compliance easier to prove and makes later upgrades less unpleasant.

The LGPL license explained through distribution examples

The build method changes the work you have to ship.

Dynamic linking

With dynamic linking, the application loads the LGPL library as a separate shared object at runtime. A user can replace that shared library with a compatible modified build.

This is usually the cleanest route for a proprietary application. You still provide the library source, notices, and license text.

Static linking

Static linking copies library code into the application binary. The user cannot replace the library unless you provide another way to rebuild the application with a modified version.

For LGPL compliance, provide the larger binary object file or another linkable form that allows relinking with a modified library. The application's source code is not automatically required just because the object file is required.

Static linking is permitted, but it creates paperwork and build obligations. If your release process cannot preserve the relinking path, use dynamic linking instead.

For a practical treatment of this exact problem, see LGPL static linking.

Plugins

A plugin arrangement needs a real analysis. A plugin loaded by a stable application interface may be separate, but the answer depends on how the plugin, application, and library code are combined.

Do not call every plugin an independent work and move on. Check whether the plugin contains library code, modifies the library, or forms a combined work with it.

Bundling

Putting an LGPL library beside a proprietary application in one installer does not by itself make the application LGPL. The GPL also says that including a covered work in an aggregate does not cause the license to apply to the other independent parts of that aggregate.

Bundling still requires the notices, license text, source access, and any relinking materials that apply to the library.

Distribution without modification

If you distribute an unmodified LGPL library with your application, you still need to provide its source and preserve its notices. Avoid the common mistake of treating “we did not edit it” as “we have no obligations.”

The obligations begin with distribution, not with the moment you first add the dependency.

GNU LGPL license compliance checklist

Run this checklist before shipping the binary.

  1. Identify every LGPL component and record its exact license version.
  2. Keep the copyright notices and license notices intact.
  3. Include the applicable LGPL license text with the distribution.
  4. Add an open source notice that identifies the library.
  5. Provide the complete corresponding source code for the LGPL library.
  6. Include every change made to the library.
  7. Document the build environment needed to produce the library.
  8. Check whether static linking requires object files or another relinking method.
  9. Confirm that users can replace the library with a compatible modified build.
  10. Check the final package, installer, and documentation rather than only the source repository.

If you distribute the application through several channels, check each one. A compliant archive does not fix a noncompliant installer that omits the notices and source offer.

For the broader licensing decision, use this guide to choosing an open source license. It starts with the downstream rights you want, which is where the decision belongs.

Lesser GNU Public License is an outdated name

“Lesser GNU public license” is a common search phrase, but it is not the current formal name. Use GNU Lesser General Public License, GNU LGPL, or LGPL.

The old “Library General Public License” name explains why older documentation may use “LGPL” differently. It does not change the license terms in the file you are distributing.

The version identifier matters more than the nickname. Put the exact identifier in your project metadata and license notices.

LGPL or GPL: which license should you choose?

Choose the LGPL for a reusable library when you want broad adoption, including use inside proprietary and commercial applications. That is the best overall choice for library authors who care more about reach than downstream copyleft.

Choose the GPL when you want programs built on your code to remain free under strong copyleft. Accept that some proprietary developers will skip the library. That is the cost of the requirement, and sometimes it is the point.

Use this decision:

  • Choose LGPL if proprietary applications should be able to link to the library.
  • Choose GPL if downstream combined works must remain GPL-covered.
  • Choose LGPL if the library is meant to be embedded across many products.
  • Choose GPL if preventing proprietary derivatives matters more than adoption.
  • Do not choose LGPL and then complain that commercial software uses the library. That is the feature working as designed.

Device drivers and low-level components are common LGPL candidates when the author wants hardware vendors to ship the code. If you need the strongest downstream copyleft, the GPL is the cleaner choice. See where Linux kernel GPLv2 licensing is defined before mixing a kernel component with user-space licensing assumptions.

Common LGPL and GPL mistakes

The first mistake is treating all linking as automatically prohibited under the LGPL. The LGPL exists to permit defined forms of linking by proprietary applications. Read the conditions instead of applying a blanket ban.

The second mistake is treating the LGPL as permission to ignore source obligations. It is not. You still provide the library source, notices, license text, and relinking materials required by the distribution method.

The third mistake is assuming dynamic linking solves everything. It usually handles the cleanest relinking path, but it does not replace the source and notice duties.

The fourth mistake is copying the first license header you find. Check the actual version and whether the project says “only” or “or later.” A version mismatch can change the result.

The fifth mistake is releasing a modified LGPL library without releasing the changes. Your application can stay closed, but the modified library does not get the same exemption.

The sixth mistake is relying on the build README instead of the binary. Check the link command, package contents, and final installer. A build that was dynamic in development can become static in a release profile. The linker does not care what the README promised.

FAQ

Does using an LGPL library force my application to become open source?

No. A separate application can remain proprietary when it links to an LGPL library under the license conditions. You still need to preserve notices, provide the library source, and maintain the user's ability to replace or modify the library.

Can I sell software that uses an LGPL library?

Yes. The LGPL permits commercial distribution. Selling the application does not remove the library's source, notice, or relinking requirements.

Do I need to release changes to an LGPL library?

Yes, if you modify the library and distribute it. Release those changes under the applicable LGPL terms. Changes to your separate application are not automatically subject to that same requirement.

Is LGPL compatible with GPL software?

Generally, LGPL code can be included in a GPL-covered project under the GPL's terms. GPL code cannot normally be added to an LGPL library while keeping the resulting library under plain LGPL terms.

Which identifier should I use for LGPL version 3?

Use LGPL-3.0-only when the project permits only version 3.0. Use LGPL-3.0-or-later when the project permits version 3.0 or a later LGPL version. The older LGPL-3.0+ identifier is deprecated.