Apache vs MIT License: Patents, BSD and GPL Compared

November 11, 2026 · 11 min read

MIT vs Apache License: Differences, Plus BSD and GPL

The Apache vs MIT license choice comes down to patents and paperwork. Both are permissive, so anyone can use, modify and sell your code. Apache 2.0 adds an explicit patent grant, a trademark clause and duties to mark changed files and pass on a NOTICE file. MIT only asks people to keep your copyright and license notice.

This comparison adds BSD and the GPL, then covers what each license makes you ship, which ones mix with GPL code, and how to declare your pick in a repo.

Apache vs MIT License at a Glance

MIT is a short permissive license of a few paragraphs. Apache 2.0 is also permissive but runs to nine sections, and most of the extra length deals with patents, contributions and notices. This table compares the license texts directly, with BSD-3-Clause and GPL-3.0 added for context.

MITApache-2.0BSD-3-ClauseGPL-3.0
TypePermissivePermissivePermissiveCopyleft
Explicit patent grantNoYes (Section 3)NoYes (Section 11)
Patent retaliationNoYes (Section 3)NoYes (Section 10)
TrademarksNot mentionedNot granted (Section 6)No endorsement using authors' namesCan be withheld (Section 7e)
Keep noticesCopyright and licenseLicense, notices, NOTICE contentsCopyright, conditions, disclaimerLicense and notices
Mark changed filesNoYesNoYes, with a date
Ship source of changesNoNoNoYes, when you convey
GPLv2 compatibleYesNo, per the FSFYesNo
GPLv3 compatibleYesYesYesSame license
SPDX identifierMITApache-2.0BSD-3-ClauseGPL-3.0-only or GPL-3.0-or-later

This is a plain-language reading of the license texts, not legal advice. If a client contract, an acquisition or a patent dispute is involved, have a lawyer look at your specific case.

How the Apache 2.0 Patent Grant and Termination Clause Work

Section 3 of the Apache License 2.0 says each contributor grants you a royalty-free patent license. It covers the patent claims their own contribution necessarily infringes, alone or combined with the project. So if a company contributes code that uses one of its patents, it can't later sue users of that code over that patent.

The same section has a catch. If you start patent litigation claiming the work infringes a patent, your patent licenses under Apache 2.0 for that work end on the day you file. That retaliation clause is why the Free Software Foundation recommends Apache 2.0 over other permissive licenses for substantial programs.

The MIT text doesn't mention patents at all. Some lawyers argue its broad grant to "deal in the Software" implies a patent license, but that reading is debated. Trademarks differ too: Apache's Section 6 withholds the licensor's trade names and marks, while MIT stays silent. So patents and trademarks are the main legal differences between the two licenses. Most of the rest is paperwork.

We prefer Apache 2.0 for anything a company might build a product on, because the patent terms are written down. For small libraries, snippets and config files, MIT's short text is easier for everyone to read and accept.

What Each License Makes You Do When You Ship Code

Most obligations kick in when you distribute the code, not when you use it privately. Here's the checklist each license text sets out for redistribution.

  • MIT: include the copyright notice and permission notice in all copies or substantial portions of the software. That's the only condition.
  • Apache 2.0 (Section 4): give recipients a copy of the license and add prominent notices to files you modified. Keep existing copyright, patent, trademark and attribution notices, and carry over the attribution text from any NOTICE file.
  • BSD-3-Clause: keep the copyright notice, conditions and disclaimer in source, and reproduce them in the docs of binary releases. Don't use the author's name to promote your product without permission.
  • GPL-3.0: license the whole work you convey under the GPL, keep the notices, mark your changes with a date and provide the corresponding source code.

The NOTICE file trips people up because it's optional for the original author. Section 4(d) only applies if the upstream project ships one. When it does, you must pass on its attribution notices, typically in your own NOTICE file. A minimal one looks like this:

Example Parser
Copyright 2024-2026 Jane Developer

This product includes software from the Tiny Tokenizer project,
licensed under the Apache License, Version 2.0.

Plain text is fine: the license only asks for a readable copy of the attribution notices, and you may add your own lines alongside them.

MIT vs BSD License: Two Clauses, Three Clauses and the Advertising Clause

The MIT vs BSD license question is mostly about which BSD you mean. The 2-clause BSD license (BSD-2-Clause, which the FSF calls the FreeBSD license) is functionally close to MIT. You keep the notice in source and binary docs, and the software comes with no warranty.

BSD-3-Clause adds one condition: you can't use the name of the copyright holder or contributors to endorse or promote derived products without written permission. MIT has no such clause.

The original 4-clause BSD license added an advertising clause, which required advertising materials that mention the software to acknowledge its original authors. The FSF lists this version as incompatible with the GNU GPL and urges people not to use it. You'll still find it in old code, so check the clause count before you copy a BSD license file.

Why Choose MIT Instead of the GPL?

You pick MIT over the GPL when you want the widest possible reuse, including inside closed-source products. The GPL is a copyleft license: if you convey a work based on GPL code, the whole work must carry the GPL and you must offer the corresponding source. MIT asks only for the notice.

A common myth says that touching GPL code at all forces your project open. The GPLv3 text says otherwise: Section 2 lets you make, run and propagate covered works you don't convey, without conditions. Running a modified GPL program for your own team triggers nothing. Distributing binaries or source to others does.

The GNU GPL vs the MIT license also differs on networks. Plain GPL-3.0 doesn't treat a hosted web service as conveying. The AGPL-3.0 closes that gap: Section 13 requires you to offer source to users who interact with your modified version over a network.

Choose the GPL if you want every improvement to stay open. Choose MIT, Apache or BSD if adoption matters more to you than reciprocity.

Which Licenses Can You Combine With GPL Code?

Compatibility has a direction. "A is compatible with B" means you can put A-licensed code into a B-licensed project and ship the result under B. It rarely works the other way round. The FSF's list of licenses is the reference for GPL compatibility.

MIT, BSD-2-Clause, BSD-3-Clause -> GPLv2 or GPLv3 project: yes
Apache-2.0                      -> GPLv3 project: yes
Apache-2.0                      -> GPLv2-only project: no
GPLv2-or-later                  -> combine with Apache-2.0 under GPLv3: yes
GPLv3                           -> Apache-2.0 or MIT project: only if the whole work ships as GPLv3

The Apache-to-GPLv2 block comes from the FSF, which says Apache 2.0's patent termination and indemnification provisions are requirements GPLv2 doesn't have. The Apache Software Foundation's own GPL compatibility page confirms the one-way relationship with GPLv3: Apache code can go into GPLv3 projects, but GPLv3 code can't go into Apache projects.

When MIT or BSD code lands in a GPL project, the combined work ships under the GPL. You still keep the original MIT or BSD notice on the files that came from it.

Dual Licensing: Why Rust Crates Ship MIT OR Apache-2.0

Dual licensing sidesteps the Apache vs MIT license choice: users get both licenses and follow whichever they pick. The Rust API Guidelines note that the Rust project's own software is dual-licensed under MIT or Apache 2.0. They recommend the same for crates that want maximum compatibility with the Rust ecosystem.

The pairing settles the MIT license vs Apache 2.0 trade-off by covering each one's weak spot. Users who want the explicit patent grant take Apache 2.0. Projects under GPLv2 take MIT, since Apache 2.0 doesn't fit there. You declare it with an SPDX license expression, where OR means the user may choose either license:

[package]
name = "tiny-tokenizer"
version = "0.3.1"
license = "MIT OR Apache-2.0"

The same expression works in npm's package.json, where the npm docs show it wrapped in parentheses:

{
  "name": "tiny-tokenizer",
  "version": "0.3.1",
  "license": "(MIT OR Apache-2.0)"
}

On crates.io the field is read as an SPDX 2.3 expression. Writing AND instead of OR would mean users must comply with both licenses at once. Ship both texts, usually as LICENSE-MIT and LICENSE-APACHE in the repo root.

How Do You Declare Your License in a Repo?

Put the license text in a LICENSE file at the repository root. GitHub runs the Licensee gem against that file and shows the detected license on the repo page. Without any license, default copyright law applies, so others generally can't copy, distribute or adapt your code.

Many projects also add a one-line SPDX comment at the top of each source file, such as SPDX-License-Identifier: Apache-2.0, so the license survives when someone copies a single file. Then add a License section near the end of your README:

## License

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE))
- MIT license ([LICENSE-MIT](LICENSE-MIT))

at your option.

That renders as a "License" heading, a lead-in line, a two-item bulleted list and a closing line. Each file name in parentheses links to that license file in the repo. For where this section fits among the others, see our README Markdown guide, or start from a ready-made README template.

To get the license file itself, our .gitignore and LICENSE generator covers MIT, Apache-2.0, GPL-3.0, BSD-3-Clause, ISC, MPL-2.0 and the Unlicense. It runs in your browser and fetches the full license text from GitHub's SPDX list when you click Fetch full text. Edit the README section below to match your choice. The demo also includes a small comparison table, and our Markdown table guide explains that syntax.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE)
  • MIT license (LICENSE-MIT)

at your option.

SPDX-License-Identifier: MIT OR Apache-2.0

Quick comparison

MIT Apache-2.0
Patent grant No mention Explicit
NOTICE file No Pass on if present
GPLv2 compatible Yes No
61 words349 characters18 lines
Markdown

One honest limitation of any comparison like this: it can tell you what the texts say, not how a court in your country reads them. Questions such as whether MIT carries an implied patent license, or what counts as a derivative work under the GPL, have no single answer across jurisdictions.

The Apache vs MIT license decision is short once you know what you're optimizing for. Pick MIT for brevity and the widest compatibility, Apache 2.0 for written patent terms, or both at once with MIT OR Apache-2.0. Pick the GPL when you want changes kept open. When your LICENSE file is ready, draft the README License section in the editor and check the table and links in the live preview.