Can I use GPL code in a commercial product?
Yes — with conditions that depend entirely on how you distribute. Commercial use of GPL code is permitted; what the GPL constrains is shipping. The sections below answer the questions one at a time, with the obligations generated by the same engine that powers the checker.
Is GPL free for commercial use?
Yes. Every GPL-family license permits commercial use, including selling the software. The obligations attach to distribution, not to commerce: if you distribute the combined work, it must be licensed GPL with complete corresponding source.
Dataset summaries: GPL-2.0-only — "Strong copyleft. Distributing a derivative work forces the whole work to GPLv2 with source offer. Incompatible with GPLv3 and with Apache-2.0. SaaS does NOT trigger disclosure (no distribution)." GPL-3.0-only — "Strong copyleft with patent and anti-tivoization terms. Compatible with Apache-2.0, AGPLv3, LGPLv3. Incompatible with GPLv2-only. SaaS does NOT trigger disclosure."
Can I sell software that uses GPL code?
Yes — selling is permitted. But the distributed work must carry the GPL and ship with source, and your buyers receive the same GPL rights, including the right to redistribute what they bought.
Do I have to open-source my code if I use GPL?
Only when you distribute. Internal-only use triggers nothing. A distributed product that combines your code with GPL code must be released whole under the GPL with source — a closed-source binary is not possible.
- Internal use: "Copyleft obligations are triggered by DISTRIBUTION. Internal-only use of GPL/LGPL/MPL/EPL imposes no source-disclosure duty. The exception is AGPL, where network access by users outside your organization can count."
- Distributed binary: "Permissive: include notices (Apache also needs NOTICE + change statements). Weak copyleft: disclose only the modified library/files and, for LGPL static linking, provide a relink path. Strong copyleft (GPL): NOT possible to keep proprietary if GPL code is in the derivative work. AGPL: same as GPL plus network rules."
The engine's obligations for GPL-3.0-only code under each model:
Internal use only (never distributed)
- GPL-3.0-only: retain the copyright notice and license text.
- GPL-3.0-only: state significant changes made to the code.
Proprietary software you distribute as a binary
- GPL-3.0-only: retain the copyright notice and license text.
- GPL-3.0-only: state significant changes made to the code.
- GPL-3.0-only: provide complete corresponding source of the combined work.
- GPL-3.0-only: the combined distributed work must be licensed under GPL-3.0-only.
Public SaaS / hosted web service
- GPL-3.0-only: retain the copyright notice and license text.
- GPL-3.0-only: state significant changes made to the code.
Is GPL 2.0 free for commercial use?
Yes, same as GPLv3 — commercial use is permitted, distribution triggers whole-work copyleft. The versions differ elsewhere: GPLv3 adds patent and anti-tivoization terms, and GPL-2.0-only cannot be combined with GPLv3 code or Apache-2.0 code.
The "or later" variant matters for compatibility: "Same as GPL-2.0 but the 'or later' clause permits upgrading to GPLv3, which restores compatibility with GPLv3 and Apache-2.0 code (via the v3 path)." See GPL-2.0-only vs GPL-3.0-only and Apache-2.0 vs GPL-2.0-only.
| Version | Patent grant | SaaS triggers disclosure | Combines with | In short |
|---|---|---|---|---|
| GPL-2.0-only | No | No | own version family only | Strong copyleft. |
| GPL-2.0-or-later | No | No | true | Same as GPL-2.0 but the 'or later' clause permits upgrading to GPLv3, which restores compatibility with GPLv3 and Apache-2.0 code (via the v3 path). |
| GPL-3.0-only | Yes | No | GPLv3 family | Strong copyleft with patent and anti-tivoization terms. |
| AGPL-3.0 | Yes | Yes | GPLv3 family | GPLv3 PLUS a network clause: making the software available over a network (SaaS) counts as distribution, so you must offer source to remote users. |
Does GPL apply to SaaS?
No source disclosure is triggered for ordinary GPL. Hosting is not distribution, so running GPL software as a public web service does not oblige you to release your changes. The exception is AGPL.
Dataset rule for public SaaS: "Permissive and weak copyleft: no source disclosure. GPL/LGPL: no disclosure either (hosting is not distribution). AGPL: YES, you must offer source to users interacting over the network. This is the decision that most often surprises people."
How is AGPL different for a commercial product?
AGPL-3.0 adds a network clause: making the software available over a network counts as distribution, so SaaS users must be offered the source. That single clause is why AGPL dependencies get special scrutiny in commercial SaaS.
"GPLv3 PLUS a network clause: making the software available over a network (SaaS) counts as distribution, so you must offer source to remote users. The clause that catches startups who assumed SaaS never 'distributes'." Engine obligations for AGPL software offered as a public service:
- AGPL-3.0: retain the copyright notice and license text.
- AGPL-3.0: state significant changes made to the code.
- AGPL-3.0: offer the source to users interacting with the software over the network.
More at the AGPL-3.0 page.
What about dynamic linking to a GPL library?
Linking mode does not rescue you from the GPL: unlike LGPL, the GPL's copyleft applies to the combined work whether you link statically or dynamically. If linking proprietary code to GPL code, treat the result as GPL on distribution.
Dataset rule for dynamic linking: "LGPL: dynamic linking lets proprietary code use the library with only the relink/notice duties. GPL: still copyleft on the combined work in most readings. Permissive: notices only." The library-friendly alternative is LGPL — see LGPL-2.1.
What exactly do I have to do when I distribute?
License the combined distributed work under the GPL, provide complete corresponding source, and retain copyright notices and license text. The checklist below is the engine's output for a GPL-3.0 work redistributed as open source.
- GPL-3.0-only: retain the copyright notice and license text.
- GPL-3.0-only: state significant changes made to the code.
- GPL-3.0-only: provide complete corresponding source of the combined work.
- GPL-3.0-only: the combined distributed work must be licensed under GPL-3.0-only.
Which licenses can I combine with GPL code?
Permissive licenses marked GPL-compatible in the dataset combine cleanly: MIT, BSD-2-Clause, BSD-3-Clause, ISC, BSL-1.0, Unlicense, CC0-1.0, MPL-2.0, LGPL-2.1, LGPL-3.0, GPL-2.0-or-later. Apache-2.0 is GPLv3-only. GPL-2.0-only and GPLv3 cannot be combined with each other. Check any specific pair in the matrix.
Verify any pair in the compatibility matrix or pre-load the checker with GPL-3.0.
Related: GPL-2.0-only · GPL-3.0-only · GPL-2.0-or-later · Copyleft vs permissive