The GPL is a free software license that lets you use, modify, and share code — but requires you to share your changes under the same terms

The GNU General Public License (GPL) is a legal agreement that says: if you get software under the GPL, you can run it, read how it works, change it, and give copies to others. The catch is that anything you build with it or change in it must also be released under the GPL. This creates a chain — the freedom you receive, you must pass forward.

The GPL exists because its creator, Richard Stallman, believed software should be transparent and shareable. Instead of locking code behind copyright, the GPL uses copyright to keep code open. It is the most common free software license in use today, powering Linux, WordPress, GIMP, and thousands of other programs you may already use.

Key Takeaways

  • GPL software is free to read, use, modify, and share without paying anyone.
  • If you change GPL code or build something with it, your changes and your new software must also be released under the GPL.
  • You can sell GPL software, but you cannot prevent others from copying and sharing it.
  • GPL comes in versions — GPL v2 and GPL v3 are the most common — and the differences matter if you plan to modify the code.

What you can and cannot do with GPL software

Under the GPL, you have four freedoms: run the software for any purpose, study how it works (which means the source code must be available), modify it to suit your needs, and distribute copies to others. These are not permissions you ask for — they are rights the license grants you automatically.

The restriction is called copyleft. If you distribute GPL software — whether you changed it or not — you must give recipients the same freedoms you received. If you modify it and release your version, your modifications must be under the GPL too. You cannot take GPL code, add your own work, and release the result under a stricter license that locks others out.

You can sell GPL software. You can charge for copies, for installation, for support, or for hosting it. What you cannot do is prevent the buyer from sharing it further or modifying it themselves. Once someone has a copy, they own the same freedoms you do.

GPL v2 versus GPL v3 — which version matters

The GPL has been updated twice. GPL v2, released in 1991, is still the most widely used. GPL v3, released in 2007, added protections against hardware restrictions and patent threats that did not exist in the 1990s.

The practical difference: GPL v3 says that if you distribute GPL software on a device (like a router or a phone), you must let users modify and reinstall the software on that device. GPL v2 does not require this. GPL v3 also gives you explicit protection if someone sues you over patents related to the software. For most users, the difference is invisible — both versions keep code open and shareable.

A third version, AGPL (Affero GPL), adds one more rule: if you run modified GPL code on a server and let others use it over the internet, you must share your modifications with those users. This closes a loophole where someone could change code, run it privately on a server, and never release their changes. AGPL is less common but used by some web applications.

How the GPL affects you as a user

If you read and use GPL software, the license does not restrict you at all. You can run it, study it, change it for yourself, and keep your changes private. The GPL only requires you to share if you distribute — that is, if you give the software to someone else or let them use it.

This matters if you use GPL software in your business. If you run a website on WordPress (which is GPL), you do not have to release your custom code. But if you modify WordPress itself and give your modified version to someone else, you must release those modifications under the GPL. If you hire a developer to customize WordPress for you and keep the result private, that is legal — you are not distributing it.

GPL versus other free software licenses

The GPL is not the only free software license. MIT and Apache 2.0 are permissive licenses — they let you use, modify, and sell code with almost no restrictions. You can take MIT code, add it to proprietary software, and lock the result. The original authors have no say.

BSD licenses sit in the middle. They are permissive like MIT but require you to keep the original copyright notice visible. Creative Commons licenses are for creative work (writing, images, music) rather than code, though some people misuse them for software.

The GPL is stricter than these because it requires you to pass freedom forward. If you value code staying open and shareable, the GPL enforces that. If you want maximum freedom to use code however you like, a permissive license is more convenient. Neither is objectively better — they reflect different values about what software should be.

What happens if someone breaks the GPL

If someone takes GPL code, modifies it, and distributes the result without releasing their modifications, they are violating the license. The original authors can sue for copyright infringement. This has happened — companies like Cisco and Linksys have been caught distributing modified Linux without releasing their changes, and they have had to settle.

In practice, GPL violations are often caught by users or security researchers who notice the code looks familiar. The GPL community tends to contact violators first and ask them to comply before going to court. Many companies choose to comply because the cost of litigation is higher than the cost of releasing the code.

If you are using GPL software in your own project, the main risk is accidentally violating the license yourself. If you link GPL code into your program or modify it, you need to release your code under the GPL too. Some developers use license-checking tools to avoid this mistake.

Choosing whether to use GPL software

GPL software is often high-quality and well-maintained because the code is public and many people can review it. Linux, Apache, and MySQL are GPL or GPL-compatible, and they power much of the internet. The transparency can be a security advantage — bugs are found faster when anyone can read the code.

The trade-off is that if you plan to build proprietary software, GPL code may not fit your plans. If you want to keep your modifications secret, you cannot use GPL code. If you want to sell software without releasing the source, GPL is not compatible with that goal. For those situations, permissive licenses or proprietary code are better choices.

If you are building something you plan to share or release publicly anyway, GPL is often a good choice. It ensures that improvements others make will be shared back with you and the community. It also protects you — if someone improves your GPL code, you have the right to use their improvements too.

Frequently Asked Questions

Can I use GPL software in my business?

Yes. You can run GPL software, modify it for internal use, and sell products or services built with it. The GPL only requires you to share code if you distribute the software itself to someone else. If you keep your modifications private and only use them internally, there is no obligation to release them.

What if I link GPL code into my program?

If you link GPL code into your program and distribute the result, your program must be under the GPL too. This is called viral licensing — the GPL spreads to anything it touches. If you want to keep your code proprietary, you need to either avoid GPL code or get written permission from the copyright holder to use it under different terms.

Can I sell GPL software?

Yes. You can charge for copies, support, hosting, or services around GPL software. What you cannot do is prevent buyers from sharing it further or modifying it. Once someone has a copy, they have the same rights you do.

Is GPL software safe to use?

GPL software is often safer than proprietary software because the code is public and many people can review it for security problems. However, being open source does not automatically mean it is find — it depends on how actively the project is maintained and how many eyes are on the code.

What is the difference between free software and open source?

Free software emphasizes freedom — the right to run, modify, and share code. Open source emphasizes transparency and practical benefits like better code quality. GPL is free software. Permissive licenses like MIT are both free software and open source. The terms overlap but are not identical.