What is the MIT License?

In short
The MIT License is a short, permissive open source license. It lets anyone use, copy, change, and share software, even for commercial work, as long as they keep the copyright notice and license text. The software comes with no warranty.
What the MIT License covers
The MIT License is a software license. A license is a legal text that tells other people what they may do with your code. The MIT License is one of the most common licenses in open source, and it is short enough to read in a minute. The official text is published by the Open Source Initiative at https://opensource.org/license/mit.
The license has two parts. The first is a grant of permission. It says that any person who gets a copy of the software may deal with it without restriction. That includes using, copying, modifying, merging, publishing, distributing, sublicensing, and selling copies. The second part is a set of conditions. There is only one main condition: the copyright notice and the permission notice must be included in all copies or substantial portions of the software.
The license also ends with a disclaimer. The software is provided "as is", with no warranty of any kind. The authors and copyright holders are not liable for claims or damages that come from using it.
How it works in practice
When you publish a project under the MIT License, you usually add a file named LICENSE to the repository. That file holds the license text. You also fill in two placeholders: the year and the name of the copyright holder. A typical header looks like this:
MIT License
Copyright (c) 2024 Jane Example
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...
Anyone who receives your code, or a large part of it, must keep that notice. They do not have to ask you for permission first, and they do not have to share their own changes. This is what makes the license permissive, as opposed to copyleft licenses that require derived work to use the same terms.
When to use it
The MIT License suits libraries, frameworks, and tools that you want other developers to adopt with little friction. Companies can use MIT-licensed code in closed-source products without negotiating with you. That is why many popular JavaScript, Python, and Ruby packages use it.
It is also a good fit if you want a simple, well-known license and do not want to write custom legal terms. Because it is so short, most developers and legal teams already understand it.
Common mistakes
The most frequent mistake is forgetting the notice. If you copy MIT-licensed code into your project, keep the copyright line and license text with it. Removing them breaks the license terms, even if you give credit in your README.
Another mistake is assuming the license protects you from all risk. The warranty disclaimer is written in capital letters for a reason. It removes most of the authors' liability, so do not expect support or guarantees unless you offer them separately.
A third point is that the license covers the code, not your ideas or your name. Other people can use the code in their own products, so think about trademarks and branding separately if they matter to you.
Alternatives
The Apache License 2.0 is also permissive, but it adds an explicit patent grant and requires notices for changes. The GNU General Public License is copyleft: derived works must be released under the same terms. The BSD licenses are close relatives of MIT and differ mainly in their clauses about endorsements. Choose based on how much you want to control reuse, and whether you care about patents.
If you are new to licensing, MIT is a reasonable default for small open source projects. Read the full text once before you publish, so you know exactly what you are agreeing to.
FAQ
Can I use MIT-licensed code in a commercial product?
Yes. The license allows use, modification, and sale of copies, including in commercial software. You must keep the copyright notice and permission notice with the code.
Do I have to share my changes if I modify MIT-licensed code?
No. The MIT License does not require you to publish your modifications or release your own code under the same license.
Does the MIT License come with any warranty?
No. The software is provided as is, and the authors are not liable for damages or claims arising from its use.
Where should I put the MIT License in my project?
Most projects keep the full text in a file called LICENSE at the root of the repository, with the year and copyright holder filled in.
Sources
This page is based on the official documentation below. Read it for full detail.
MIT License — official documentation ↗