The GNU License is a legal agreement that lets you use, modify, and share software freely

The GNU General Public License (GPL) is a set of rules written by the Free Software Foundation that governs how you can use and distribute software. Unlike licenses that restrict what you can do, the GPL is built on the opposite idea: it gives you permission to run the software, look at how it works, change it, and share it with others — but with one condition. If you share a modified version, you must share the source code and let others do the same thing you did.

The GPL exists because some programmers wanted their work to remain free and open rather than locked behind paywalls or corporate control. When software is released under the GPL, anyone can download it at no cost, study the code, fix bugs, add features, and redistribute it. This creates a chain: each person who receives the software has the same rights you do.

There are three main versions in use today. GPLv2, released in 1991, is the most common and appears in Linux, Git, and thousands of other programs. GPLv3, released in 2007, added protections against hardware restrictions and patent threats. AGPLv3 is stricter: it requires you to share your code even if you only run the software on a server without distributing it to users.

Key Takeaways

  • GPL software is free to download, use, modify, and share, but you must share your modifications under the same license.
  • The GPL does not mean the software is free of cost — it means you have freedom to use and change it.
  • If you distribute GPL software or a modified version, you must provide access to the source code.
  • GPLv2 is the most widely used version, while GPLv3 and AGPLv3 add stronger protections in specific situations.
  • GPL software is common in servers, development tools, and operating systems, but rare in consumer applications.

How the GPL's "copyleft" rule works

The GPL uses a legal concept called copyleft, which is the opposite of copyright. Copyright says "I own this, you cannot copy it." Copyleft says "You can copy this, but you must pass the same freedom forward." This is enforced through the license itself, not through code or technical barriers.

Here is the practical chain: You download a GPL program. You can run it, study it, and modify it. If you then share your modified version with someone else, you must give them the source code and tell them they have the same rights you do. They cannot take your changes, close the code, and sell it as proprietary software. The freedom flows forward.

This creates a strong incentive for collaboration. If you improve a GPL program and want others to use your improvements, you benefit from sharing them back to the original project. The original developers can then include your improvements in future versions, which benefits everyone. Many major open-source projects work this way.

What you can and cannot do with GPL software

You can run GPL software for any purpose, including commercial use. You can modify it, study the code, and redistribute it. You can charge money for GPL software — selling copies is legal. You can even use GPL code in a business product.

What you cannot do is distribute GPL software or your modified version without providing the source code. You cannot add restrictions that prevent others from doing what the GPL allows. You cannot claim you wrote code you did not write. You cannot take GPL code, modify it, and release it under a different, more restrictive license.

The most common mistake is using GPL code in a closed-source program without sharing the source. If you do this and someone discovers it, you are in violation. The copyright holder can demand you stop distributing the software or take legal action. This has happened to companies that embedded GPL code in proprietary products without realizing the obligation.

GPL versus other open-source licenses

Not all open-source software uses the GPL. Other licenses have different rules. The MIT License and Apache License let you use, modify, and distribute code with almost no restrictions — you can even use it in closed-source software as long as you include a copy of the license. The BSD License is similar. These are called permissive licenses because they permit almost anything.

The GPL is called a copyleft license because it requires you to pass freedom forward. This is stronger than permissive licenses but weaker than public domain, where the creator gives up all rights. Some projects use the LGPL (Lesser GPL), which allows linking GPL code into proprietary software under certain conditions — useful for libraries that many programs need to use.

The choice of license reflects the author's values. A programmer who wants maximum freedom for users chooses GPL. A programmer who wants their code used as widely as possible, even in closed products, chooses MIT or Apache. Neither is objectively better — they serve different goals.

Where you encounter GPL software

Linux, the operating system kernel used in Android phones, web servers, and many computers, is licensed under GPLv2. Git, the version control system used by most programmers, is GPLv2. WordPress, which powers roughly 40 percent of websites, is GPLv2. Many development tools, databases, and server software are GPL.

You are less likely to encounter GPL software in consumer applications like phone apps or desktop programs you buy. This is because GPL requires you to share your modifications, which many commercial companies do not want to do. However, if you run your own server or use Linux, you are using GPL software regularly.

If you are a developer and you use GPL code in your project, you need to know your license obligations. If you are a user, the GPL mostly means the software is free and you can modify it if you have the skills. The license does not affect how you use the software on your own computer — only what you can do if you share it with others.

Understanding the source code requirement

The GPL's core requirement is that if you distribute GPL software, you must provide access to the source code. Source code is the human-readable instructions programmers write; compiled code is the machine-readable version that actually runs. The GPL requires you to share the source so others can read it, modify it, and understand what the program does.

This does not mean you must host the code on a public website. You can provide it on a CD, through email, or through a download link. You can charge a fee for the media or the effort of providing it. What you cannot do is refuse to provide it or make it unreasonably difficult to obtain.

For web-based software, the rules are different depending on the license version. GPLv2 does not require you to share code if you only run the software on your own server and do not distribute it. AGPLv3 does require you to share code even if you only run it on a server, because users interact with it remotely. This is why some companies use AGPLv3 — it prevents someone from taking their code, running it on a server, and keeping the improvements private.

Frequently Asked Questions

Can I use GPL software in my business?

Yes. You can run GPL software, modify it, and use it commercially. If you only use it internally and do not distribute it, you have no obligations. If you distribute your modified version to customers, you must provide the source code under the GPL.

Do I have to pay for GPL software?

No. GPL software is free to download. Some companies charge for support, hosting, or packaging, but the software itself is free. The GPL guarantees this freedom — you cannot be charged for the right to use it.

What happens if I violate the GPL?

The copyright holder can demand you stop distributing the software or take legal action. In practice, most violations are resolved by the violator releasing the code under the GPL. Lawsuits are rare but have happened when companies ignored repeated requests to comply.

Can I mix GPL code with code under a different license?

It depends on the licenses. GPL code can be mixed with other copyleft licenses if they are compatible. Mixing GPL with permissive licenses like MIT is usually allowed, but the result must be distributed under the GPL. Mixing GPL with incompatible licenses creates legal problems.

Is GPL software less secure because the code is public?

No. Public code can be audited by many people, which often finds security problems faster. Some of the most secure software in the world, including Linux and OpenSSH, is GPL. Closed code is not inherently more secure — it is just harder to verify.