esdecode

MIT vs Apache-2.0 License

MIT License compared with Apache License 2.0: what each licence allows, and whether code under one can be used in a project under the other. Results are generated by the open-source license compatibility checker.

Quick Answer

Compatibility is directional, so both directions are answered separately (distributed software):

MIT code in a project licensed under Apache-2.0

Generally Compatible

Using MIT-licensed code in a project under Apache-2.0 is generally compatible in this scenario.

MIT permits commercial use.

Apache-2.0 code in a project licensed under MIT

Generally Compatible

Using Apache-2.0-licensed code in a project under MIT is generally compatible in this scenario.

Apache-2.0 permits commercial use.

Key Differences

  • Mark modified files: MIT: no; Apache-2.0: yes.
  • Express patent licence: MIT: no; Apache-2.0: yes.
  • Patent termination clause: MIT: no; Apache-2.0: yes.
  • Trademark rights granted: MIT: not addressed; Apache-2.0: no.

Comparison Table

MITApache-2.0
TypeOpen sourceOpen source
OSI approvedYesYes
Commercial usePermittedPermitted
ModificationPermittedPermitted
DistributionPermittedPermitted
CopyleftNoneNone
Network-use (SaaS) clauseNoNo
Source disclosureNot requiredNot required
Same licence for distributed changesNoNo
Attribution / noticesYesYes
Mark modified filesNoYes
Express patent licenceNoYes
Patent termination clauseNoYes
Trademark rights grantedNot addressedNo

Commercial Use

  • MIT: permitted.
  • Apache-2.0: permitted.
  • MIT code in a project licensed under Apache-2.0: MIT permits commercial use.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 permits commercial use.

Proprietary Software

MIT code in closed-source commercial software

Generally Compatible

Using MIT-licensed code in a proprietary project is generally compatible in this scenario.

MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Apache-2.0 code in closed-source commercial software

Generally Compatible

Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.

Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

  • MIT code in closed-source commercial software: MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.
  • Apache-2.0 code in closed-source commercial software: Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

SaaS

  • Network-use clause: MIT: no; Apache-2.0: no.

MIT code in a closed-source SaaS

Generally Compatible

Using MIT-licensed code in a proprietary project is generally compatible in this scenario.

MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Apache-2.0 code in a closed-source SaaS

Generally Compatible

Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.

Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

  • MIT code in a closed-source SaaS: MIT has no network-use (SaaS) clause.
  • Apache-2.0 code in a closed-source SaaS: Apache-2.0 has no network-use (SaaS) clause.

Modification

  • MIT: permitted.
  • Apache-2.0: permitted; modified files must be marked.

Modifying MIT code used in closed-source software

Generally Compatible

Using MIT-licensed code in a proprietary project is generally compatible in this scenario.

MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Modifying Apache-2.0 code used in closed-source software

Generally Compatible

Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario.

Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

  • Modifying MIT code used in closed-source software: MIT permits modification.
  • Modifying Apache-2.0 code used in closed-source software: Apache-2.0 permits modification. Apache-2.0 requires modified files to carry notices stating that they were changed.

Distribution

  • MIT: permitted.
  • Apache-2.0: permitted.
  • MIT code in a project licensed under Apache-2.0: MIT permits distribution.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 permits distribution.

Copyleft

  • MIT: none copyleft.
  • Apache-2.0: none copyleft.
  • MIT code in a project licensed under Apache-2.0: MIT has no copyleft.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 has no copyleft.

Source Disclosure

  • MIT: not required.
  • Apache-2.0: not required.
  • MIT code in a project licensed under Apache-2.0: MIT does not require you to publish source code.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 does not require you to publish source code.

Attribution

  • MIT: Include the copyright notice and permission notice in all copies or substantial portions.
  • Apache-2.0: Give recipients a copy of the licence.
  • Apache-2.0: Cause modified files to carry prominent notices stating that you changed them.
  • Apache-2.0: Retain copyright, patent, trademark and attribution notices from the source form.
  • Apache-2.0: If a NOTICE file is included, include its attribution notices in the distribution.
  • MIT code in a project licensed under Apache-2.0: MIT requires the copyright and licence notices to be kept with copies you distribute.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 requires the copyright and licence notices to be kept with copies you distribute. If the Apache-2.0 component ships a NOTICE file, its attribution notices must be reproduced in your distribution (section 4(d)).

Patent Considerations

  • Express patent licence: MIT: no; Apache-2.0: yes.
  • Patent termination clause: MIT: no; Apache-2.0: yes.
  • MIT code in a project licensed under Apache-2.0: MIT contains no express patent licence. Any patent permission would depend on implied licence doctrines, which vary by jurisdiction.
  • Apache-2.0 code in a project licensed under MIT: Apache-2.0 includes an express patent licence from contributors. That patent licence terminates for anyone who initiates patent litigation alleging that the work infringes a patent.

Common Scenarios

ScenarioMIT code in a project licensed under Apache-2.0Apache-2.0 code in a project licensed under MIT
Use as a dependency / libraryGenerally CompatibleGenerally Compatible
Copy source code into the projectGenerally CompatibleGenerally Compatible
Modify the componentGenerally CompatibleGenerally Compatible
SaaS / network service (not distributed)Generally CompatibleGenerally Compatible
Internal / private use onlyGenerally CompatibleGenerally Compatible
Resell the softwareGenerally CompatibleGenerally Compatible
White-label / rebrandGenerally CompatibleGenerally Compatible

FAQ

Can I use MIT code in a project licensed under Apache-2.0?

Using MIT-licensed code in a project under Apache-2.0 is generally compatible in this scenario. MIT permits commercial use.

Can I use Apache-2.0 code in a project licensed under MIT?

Using Apache-2.0-licensed code in a project under MIT is generally compatible in this scenario. Apache-2.0 permits commercial use.

Can MIT-licensed code be used in closed-source commercial software?

Using MIT-licensed code in a proprietary project is generally compatible in this scenario. MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Can Apache-2.0-licensed code be used in closed-source commercial software?

Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario. Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Do I have to publish my source code when I use MIT code?

MIT does not require you to publish source code.

Do I have to publish my source code when I use Apache-2.0 code?

Apache-2.0 does not require you to publish source code.

Can I use MIT code in a closed-source SaaS?

Using MIT-licensed code in a proprietary project is generally compatible in this scenario. MIT generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Can I use Apache-2.0 code in a closed-source SaaS?

Using Apache-2.0-licensed code in a proprietary project is generally compatible in this scenario. Apache-2.0 generally allows the code to be included in proprietary software without releasing your source code, provided its notices are kept.

Try the Interactive Checker

Change the scenario, say whether the code is modified, distributed or offered as SaaS, and see every rule that applies.

Related Comparisons

Authoritative Sources

This tool provides general software licensing information and is not legal advice. License obligations may depend on how software components are combined, modified, distributed and used. For high-risk results, review the actual license text before relying on this result.