MIT vs Apache-2.0: Picking Between the Two Most Common Permissive Licences
Both licences let anyone use, modify and redistribute your package, including in closed-source products. The differences are in the fine print: patents, notice files and how much text a downstream user has to carry along. This comparison is written for authors choosing a licence for a new package, and it is general information, not legal advice.
The comparison table
| Question | MIT | Apache-2.0 |
|---|---|---|
| Length of the licence text | A few short paragraphs | Several pages with defined terms |
| Explicit patent licence from contributors | No | Yes (section 3) |
| Patent termination if a user sues | No | Yes, the patent licence ends for that party |
| Must keep copyright and licence text | Yes | Yes |
| Must state changes to modified files | No | Yes, modified files need a notice |
| NOTICE file handling | Not a concept | If the project ships a NOTICE file, redistributors must pass it on |
| Trademark grant | Silent | Expressly not granted |
| SPDX identifier | MIT | Apache-2.0 |
| Compatible with GPL-3.0 code | Yes | Yes (the FSF considers it incompatible with GPL-2.0-only) |
How to read the result
The patent clause is the real decision point. If your package implements something a contributor's employer could plausibly hold patents on, such as a codec, a compression scheme or a cryptographic routine, Apache-2.0 gives users a written promise that contributors license those patents along with the code. MIT is silent, and lawyers disagree about how much is implied. For a string utility or a CLI wrapper the clause rarely matters in practice.
Notice obligations cost downstream users effort. With MIT, a product that bundles your package needs to carry your copyright line and the licence text. With Apache-2.0 it also needs to pass on your NOTICE file, if you have one, and mark files it modified. Large companies have processes for this; a solo developer embedding your code may not notice. Keep your NOTICE file short, or skip it, to reduce friction.
GPL-2.0-only projects are the one compatibility trap. If you expect your library to be linked into GPL-2.0-only software, MIT avoids the incompatibility the Free Software Foundation describes for Apache-2.0. Many authors handle this by dual licensing as MIT OR Apache-2.0, which is the convention across much of the Rust ecosystem.
Declaring your choice
# package.json
"license": "Apache-2.0"
# pyproject.toml (PEP 639 style, if your build backend supports it)
license = "MIT OR Apache-2.0"
# Cargo.toml
license = "MIT OR Apache-2.0"
Put the full text in a LICENSE file (or LICENSE-MIT and LICENSE-APACHE when dual licensing) at the repository root so that it ends up inside the published artefact. The SPDX identifier how-to covers the expression syntax, and the wider permissive versus copyleft guide explains where these two sit among the alternatives.
Verdict by situation
- Small utility, solo maintainer, minimal friction wanted: MIT.
- Corporate contributors or patent-sensitive algorithms: Apache-2.0.
- Want both audiences happy: dual
MIT OR Apache-2.0, with both files shipped.
The full texts are on the SPDX License List and at the Open Source Initiative; choosealicense.com has a short plain summary of each.