MIT License: Meaning, Full Text and How to Add It

November 11, 2026 · 11 min read

MIT License: What It Means, the Full Text and How to Add It

The MIT License is a short permissive open source license. It lets anyone use, copy, modify, merge, publish, distribute, sublicense and sell your code, as long as they keep your copyright and license notice with it. This guide explains each clause in plain English, then shows the exact LICENSE file, README section and badge to add.

What Is the MIT License?

This license started at the Massachusetts Institute of Technology in the late 1980s. The Open Source Initiative approves it, and its SPDX identifier is simply MIT. Babel, .NET and Rails all use it, according to GitHub's choosealicense.com page for MIT.

If you're after the MIT license meaning in one line: do what you like, but keep the notice. That's why the MIT open source license appeals to so many maintainers. There's no copyleft rule, so code that uses it can stay closed. Apart from the grant and that one condition, the text is a disclaimer that protects the author.

A quick note before the details: this post explains what the text says, but it isn't legal advice. If your company, a client contract or a patent question is involved, ask a lawyer who can look at your situation.

The MIT License Text, Clause by Clause

Here is the full text as the Open Source Initiative publishes it. It's about 170 words.

Copyright <YEAR> <COPYRIGHT HOLDER>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

It breaks into four parts, and each one does a single job.

Copyright line. It names who owns the code and when it was first published. You keep ownership. The license only grants permission to others.

Grant of rights. "Permission is hereby granted, free of charge, to any person" means every recipient gets the same rights without asking you. The verbs (use, copy, modify, merge, publish, distribute, sublicense, sell) cover almost anything someone would do with code. Sublicense means they can pass those rights on to others, so the code can ship inside a larger work distributed under different terms.

Condition. The copyright notice and the permission text must travel with every copy, or with any substantial portion of it. That's the only obligation a user takes on. The text doesn't define substantial, which is one of its known grey areas.

Disclaimer. The all-caps paragraph says the code comes as is. If it breaks something, the authors don't owe a fix, a refund or damages. Licenses often set this part in capitals so it stands out, since some laws expect warranty disclaimers to be conspicuous.

What Does It Mean When Something Is MIT-Licensed?

When a package says it's MIT-licensed, you can use it in personal, open source or commercial work, change it, and ship it inside your own product. You don't need to ask permission, pay, or tell the author. You also don't have to release your own source code.

What you don't get matters as much:

  • No warranty. If the library has a bug that costs you money, the license says the author isn't liable.
  • No explicit patent grant. The text never mentions patents. Some commentators read the grant as covering them implicitly, but it isn't spelled out.
  • No trademark rights. The text grants rights to the code only. It says nothing about the project's name or logo, so don't assume you can use them to promote your product.

For authors, the flip side is simple. You give up control over how the code is used, and in exchange your work spreads with very little friction. Most developers already know what MIT allows, so adopting your library rarely needs a long license review.

Can You Use MIT-Licensed Code Commercially?

Yes. The grant includes the word sell, and choosealicense lists commercial use and private use among the permissions. You can bundle MIT code into a paid app, a closed-source SaaS product or client work.

The one requirement still applies. Here's how teams usually meet it in practice:

  1. Vendored source. If you copy a library into your repo, keep its LICENSE file in that folder.
  2. Bundled web apps and binaries. Ship a third-party notices file (often called THIRD-PARTY-NOTICES or licenses.txt) that lists each package with its copyright line and license text. Many build tools have plugins or commands that collect these for you.
  3. Mobile and desktop apps. An About or Open source licenses screen that shows the notices is the common pattern.

What you can't do is strip the notice out and present the code as entirely your own. If you only learned an idea from MIT code and wrote your own version, the condition generally doesn't come into play, because you didn't copy the code.

How to Add the MIT License on GitHub

GitHub has a built-in template, and GitHub's docs describe the steps:

  1. Open your repository's main page and choose Add file, then Create new file.
  2. Name the file LICENSE or LICENSE.md, in capitals.
  3. Click Choose a license template, then pick MIT License from the list.
  4. Click Review and submit, then Commit changes.

Once GitHub detects the license, visitors see it at the top of the repository page and can click the license name to read the full file.

If you'd rather build the file offline, our .gitignore and LICENSE generator has a LICENSE tab. For MIT it fills your year and copyright holder into the standard text, shows a short header for source files, and lets you copy or download the result. It runs in your browser and can't commit to your repository, so you still add the file yourself.

Package registries read the license from your manifest too. Use the SPDX identifier:

{
  "name": "my-project",
  "license": "MIT"
}

That's package.json for npm. In Rust's Cargo.toml the equivalent line is license = "MIT" under [package]. Registries then show MIT on the package page.

MIT License Example: A Filled-In LICENSE File

Here's a filled-in MIT license example. Save it as LICENSE in the repository root:

MIT License

Copyright (c) 2026 Jane Doe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

A few details people ask about:

  • The year. choosealicense says to use the current year when you add the license. Many projects keep that first year, and others later switch to a range such as 2021-2026. Both are common.
  • The holder. Use your full name, your company's legal name, or a phrase like The my-project contributors for community projects.
  • The file name. LICENSE, LICENSE.md and LICENSE.txt all work. choosealicense suggests LICENSE or LICENSE.txt in the root.

You don't need the full text in every source file. If you want file-level labels, the SPDX convention is a single comment line at the top of each file, such as // SPDX-License-Identifier: MIT. Tools that scan dependencies read that line.

Adding a License Section and Badge to Your README

A LICENSE file is the legal part. A short License section in your README tells visitors the answer before they go looking. Put it near the end:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

## License

Released under the MIT License. See [LICENSE](LICENSE) for the full text.
Copyright (c) 2026 Jane Doe.

The first line goes under your project title. It renders a two-part badge reading License | MIT that links to your LICENSE file. The section at the bottom renders as an H2 with a sentence and a link.

Shields.io can also read the license GitHub detected, with a URL like https://img.shields.io/github/license/OWNER/REPO. Our badge generator builds other shields.io badges, and the README Markdown guide covers the rest of a README.

Try it below. Swap in your project name and your own copyright line, and the preview updates as you type. The badge image loads from shields.io.

my-project

License: MIT

A small library for parsing dates.

License

Released under the MIT License.
Copyright (c) 2026 Jane Doe.
See the LICENSE file for the full text.

30 words241 characters9 lines
Markdown

If you want a complete README with installation, usage and contributing sections already laid out, start from one of our Markdown templates.

MIT License Variants: MIT-0 and X11

Two close relatives show up in search results and SPDX lists.

MIT-0 (MIT No Attribution) removes the condition entirely, so users don't even have to keep your notice. The OSI approved it in 2020, and its SPDX identifier is MIT-0. Pick it when you'd like the code to behave almost like public domain while keeping the warranty disclaimer.

X11 is a variant best known from its use by the X Consortium. It adds a clause saying the copyright holders' names can't be used in advertising without permission. The text GitHub and the OSI call the MIT License is the variant sometimes named Expat, which has no advertising clause.

We prefer plain MIT for small libraries and tools, because almost every developer and legal team recognises it on sight. The real limitation is patents: the text doesn't address them, so for patent-heavy work a license with an explicit patent grant, such as Apache 2.0, is the safer starting point. Our MIT vs Apache license comparison covers the patent grant and what each license asks of you.

The MIT License gives away almost every right while asking for one thing in return: keep the notice. Add a LICENSE file to the root of your repository, set "license": "MIT" in your package manifest, and finish with a short License section and badge in your README. Draft that README in the editor, check the badge and links in the live preview, then download the .md file and commit it.