# Can I use GPL-2.0 code commercially?

**Short answer:** Selling or shipping a program with GPL-2.0 code: Yes. Running it as an online service without distributing it: Yes.

GPL-2.0 allows commercial use and sale; anyone you distribute the program to must get the complete source under GPL-2.0.

## Selling or shipping a program with GPL-2.0 code — Yes

License: [GNU General Public License v2.0 only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (`GPL-2.0-only`, curated)

- Every use you described is granted by GPL 2.0, and nothing you described is prohibited.

Duties: attribution, license_notice, state_changes, share_alike, source_disclosure
## Running it as an online service without distributing it — Yes

License: [GNU General Public License v2.0 only](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) (`GPL-2.0-only`, curated)

- Every use you described is granted by GPL 2.0, and nothing you described is prohibited.

Duties: attribution, license_notice, state_changes, share_alike, source_disclosure

## Context
- GPL-2.0 conditions attach to distribution; a hosted service that never ships the program does not trigger them (AGPL-3.0 closes that gap, GPL-2.0 does not).
- GPL-2.0-only code cannot be combined with Apache-2.0 code in one program; GPL-2.0-or-later can, by moving to GPL-3.0.

## Sources
- [GNU GPL v2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
- [GNU GPL FAQ](https://www.gnu.org/licenses/gpl-faq.html)

## Check it yourself (free, no key)
```json
{
  "tool": "check_license",
  "arguments": {
    "license": "GPL-2.0-only",
    "intended_use": {
      "commercial_use": true,
      "redistribution": true
    }
  }
}
```
REST: POST https://www.rightshold.com/v1/licenses/check

_Computed from Rightshold's license profiles; not legal advice. Updated 2026-10-23. JSON: https://www.rightshold.com/answers/can-i-use-gpl-2-0-code-commercially.json_