Open Source Licenses Explained: MIT, Apache, and GPL in Plain English

Open Source Licenses Explained: MIT, Apache, and GPL in Plain English

Open source licenses explained in plain English: a license is the set of rules that tells you what you can and cannot do with someone else’s code. The code may be free to download, but without a license you have no legal right to use it, copy it, change it, or ship it inside your own product. Public on GitHub does not mean free to take. The license file is what gives you permission, and each license gives a different kind.

This guide covers the three licenses you will meet most often, MIT, Apache 2.0, and GPL: what each allows, where each draws the line, and which mistakes catch teams out. I am not a lawyer, and this is general information, not legal advice. For a high-stakes decision, talk to a lawyer who knows software licensing.

Open Source Licenses Explained in One Paragraph

The author keeps the copyright, but the license grants you rights to use, copy, change, and share the code, as long as you follow its conditions. MIT asks for almost nothing in return. Apache 2.0 asks for a little more, and adds patent protection. GPL asks for the most: if you share a modified version, it must carry the same license.

That last difference is the one that matters most. Permissive licenses, like MIT and Apache, let you use the code in closed, commercial software. Copyleft licenses, like GPL, require you to pass the same freedom on. The permissive vs copyleft split tells you most of what you need to know before you add a dependency.

The MIT License: Short, Permissive, Everywhere

The MIT License is about 170 words long, and you can read the whole thing in two minutes. That brevity is a big part of why it is the most used license on GitHub. It lets you do almost anything: use it in a commercial product, change it, sell software that includes it, and keep your own code closed. The only condition is that you include the original copyright notice and the license text.

MIT says nothing about patents. That is fine for most small libraries. The trade-off is that if a contributor later claims their patent covers the code, the license itself gives you no direct defence. For a large project with many corporate contributors, teams often want more cover, which is where Apache comes in.

MIT is a good default when you want the widest possible adoption of your own code. If you publish a library under MIT, anyone can use it, including companies that will never show you their source.

The Apache License 2.0: MIT With Patent Protection and Paperwork

Apache 2.0 is a permissive license like MIT, so you can use Apache-licensed code in commercial, closed-source products. The difference is that Apache spells out more: an express grant of patent rights from each contributor, so a contributor cannot later sue you for patent infringement over code they contributed. It also requires you to note changes you made, and to keep any NOTICE file that came with it.

That extra paperwork is modest: a short note about your changes and a copied NOTICE file. In return you get clearer protection, which is why Apache 2.0 is common in large company-backed projects.

Choosing between MIT and Apache usually comes down to one question: does patent protection matter for this code? For a small helper library, MIT is simpler. For a project companies may build products on, Apache 2.0 is the safer pick. Both are widely accepted by company legal teams, which is why the choice of where you host the code rarely matters as much as the license file inside it.

The GPL: Copyleft, and the License That Shares Back

The GNU General Public License, or GPL, works on a different idea. It lets you use, change, and share the code, but if you distribute a modified version, or a program built on it, that program must also be licensed under the GPL, with its source available to the people who receive it. This is copyleft: the freedom to use the code comes with a duty to pass the same freedom on.

That rule only bites when you distribute the software. Running GPL code on your own server for your own team, without giving the software to anyone else, does not force you to publish your source. The line that matters is distribution: handing the program to customers, or shipping it inside a product they install.

GPL version 3 added terms about patents and about hardware that blocks modified software from running. GPL version 2, from 1991, is still used by large projects, including the Linux kernel. The two versions are not the same license, so read the version number, not just the letters GPL. The GNU Affero GPL, or AGPL, closes the server loophole: if people use your modified AGPL program over a network, you must offer them the source. If you run a SaaS product, check for AGPL in your dependency tree.

MIT vs Apache vs GPL: Side-by-Side Comparison

The MIT Apache GPL comparison below sums up the three licenses. Read the license text itself before a decision that affects a product you sell.

Rule MIT Apache 2.0 GPL (v2 / v3)
Use in commercial products Yes Yes Yes
Keep your own code closed Yes Yes No, if you distribute it
Must include license and copyright notice Yes Yes Yes
Must state changes you made No Yes Yes
Patent grant from contributors No Yes, express grant Yes, express grant (v3 stronger)
Copyleft No No Yes, strong copyleft
Can you relicense your modified version? Yes Yes No, it must stay GPL
Typical use Libraries, small tools Large projects, company-backed code Tools whose authors want changes shared back

All three allow commercial use, despite the myth that open source code cannot make money. What differs is what you must give back.

Using Open Source Code in Commercial Projects

Most commercial software today is built on open source libraries. You pick libraries with permissive licenses, keep a list of what you use, include the required notices, and ship your product. For MIT and Apache that price is small: a notice file and, for Apache, a note about your changes.

The practical work is keeping track of your dependencies. A modern project can pull in hundreds of packages without anyone on the team reading each license, and that is how GPL code slips into a closed product unnoticed. Use a license checker in your build pipeline so new dependencies get flagged before they reach production. Audits often turn up packages you did not know were there, so the habit of reviewing what goes into your repositories pays off here too, and it is a basic part of using open source commercially.

Your own code needs a license decision as well. Publishing a project with no license file means nobody has permission to use it, even if they can see the source. Add a license file at the root of the repository before you share the link. Many developers start contributing by fixing a small bug, and finding a good first issue is easier once you can read a license file and know what it permits.

Common Mistakes and How to Avoid Them

The most common mistake is assuming code with no license is free to use. It is not. No license means all rights reserved. If you find useful code with no license, ask the author to add one before you use it.

The second mistake is mixing GPL code into a closed product and only finding out during a sale or an audit. A buyer doing due diligence will ask for your license list. Check licenses when you add a dependency, not when someone else asks.

The third mistake is changing a license without the right to do so. Only the copyright holders can change a project’s license, so relicensing a project with many contributors needs their agreement.

The fourth mistake is forgetting the notice requirements. MIT and Apache both ask you to keep the copyright notice with the code. Stripping license headers from files you copied is a breach of the license. Keep the notice with the code, and if you change a file, say so where Apache requires it.

The fifth mistake is treating version numbers as decoration. Code is often released under a versioned license, and the version changes the terms. Keep the version number with the license name in your records, the same way you would track a dependency version when you decide when to bump a version number.

MIT gives you freedom with a notice. Apache adds patent cover and a little paperwork. GPL gives you freedom on the condition that you share it back. Pick the license that matches what you want, check the license on code you borrow, and write the choice down.

Ditulis oleh

Firdaus Safari Putra

Founder, PT FirKaizen Digital Solutions

Firdaus Safari Putra adalah founder PT FirKaizen Digital Solutions. Ia membangun dan mengoperasikan infrastruktur server di balik panduan ini, dan menulis berdasarkan apa yang benar-benar ia jalankan, uji, dan ukur — bukan teori.