GPL
The flagship strong-copyleft (“share-alike”) open-source license: you can use, modify, and sell the code, but if you distribute a derivative app, you must open-source it under GPL too.
On this page
What is GPL?
GPL (GNU General Public License) is a strong copyleft open-source license created by the Free Software Foundation (FSF). Anyone can run, study, modify, and even sell GPL software—with one firm rule: if you distribute a modified or combined program to others, you must release the full derivative source code under the same GPL license.
Think of GPL like “shared seeds”: you can plant them, breed a better crop, and even sell the fruit—but if you hand out or sell your improved seeds, you must let buyers plant and share them freely too instead of locking them up.
GPL is designed so software built on open-source code stays open-source whenever it is distributed.
How does GPL copyleft work?
The key to understanding GPL is knowing what triggers the share-source rule:
Include GPL code: your project modifies a GPL program or integrates a GPL library into your application.
Edit internally: while you only run and test changes privately on your own computer or inside your company, you do not have to publish anything.
Distribute the app: the moment you ship the combined program to outside users—free or paid—GPL’s copyleft obligation kicks in.
Share the source under GPL: you must make the complete corresponding source code of the derivative app available under the same GPL license.
The two main versions are GPLv2 (used by the Linux kernel and Git) and GPLv3 (which adds explicit patent rules and anti-lockdown protections). A softer sibling, LGPL, allows closed-source apps to link to a library under specific conditions.
Read a GPLv3 source header
Because the full GPLv3 text is lengthy, projects place the full license in LICENSE (or COPYING) and add a short notice to source files:
- “Free software” here means freedom to inspect, change, and share the source code—not necessarily zero price.
- It specifies the exact version (version 3) and whether later versions are allowed (
or any later version). - Like other open-source licenses, it disclaims warranties.
Here is the official GNU GPLv3 header template:
Copyright (C) 2026 Alex Chen
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.Whenever a dependency audit flags GPL-2.0 or GPL-3.0, pause and check whether your project is ready to be released under GPL.
How is GPL different from MIT?
GPL and MIT reflect two philosophies in open source: keeping downstream improvements open vs. allowing frictionless reuse everywhere.
| Compare | GPL (strong copyleft) | MIT License (permissive) |
|---|---|---|
| Distributing a derivative app | The whole derivative app generally must be open-sourced under GPL | Can stay closed-source |
| Private or internal-only use | No need to publish source if you never distribute it | No need to publish source |
| Core goal | Keep improvements open and flowing back to users | Make adoption as simple and unrestricted as possible |
One famous boundary of standard GPL: if you modify GPL code and run it solely on your own server as a website without distributing binaries, GPL does not force you to share the server code—which is exactly why AGPL was created.
When is GPL a good fit?
Choose GPL when you want improvements built on your project to remain open to the community instead of turning into closed-source competitors.
- Operating systems and developer tools: the Linux kernel and Git use GPLv2 so industry improvements flow back to everyone.
- Open-source apps and CMS platforms: WordPress, Blender, and GIMP thrive under GPL.
- Dual-licensing models: projects offer the software free under GPL to open-source users, and sell a separate commercial license to companies that want closed-source embedding.
Protects a project’s open-source future and encourages companies to contribute improvements back.
Many closed-source commercial apps avoid GPL libraries for compliance reasons, which can limit adoption compared with MIT or Apache 2.0.
Common things people get wrong
Is it illegal to sell GPL software for money?
No. “Free software” refers to freedom, not price. You can sell copies of GPL software or paid support, as long as buyers also receive the source code and GPL freedoms.
If I modify GPL code only for internal company use, must I publish it?
No. GPL’s share-source rule is triggered by distribution. Private or internal-only modifications do not have to be released.
If my closed-source desktop app uses just one small GPL library, can the rest stay private?
Usually no. Integrating GPL code into a distributed app typically requires licensing the combined app under GPL too. Closed-source teams usually swap in an MIT/Apache library or buy a commercial license.
Quick quiz
Your team builds a downloadable paid desktop app and bundles a GPLv3 chart library inside it. Can you keep the rest of your app closed-source?
No. Shipping a combined app with a GPLv3 library triggers copyleft, requiring the app’s source code to be licensed under GPLv3 too. Swap in a permissive library (like MIT or Apache 2.0) or obtain a commercial license instead.
Remember this: GPL allows using and selling, but distributing a derivative app requires sharing its full source under GPL.
Read further
Read the official GPLv3 text and guides below.