Code and repositories / Read code
See the license of a repository
You want to know if you can use the code of a repository, and what the license asks of you. The home page of the repository shows the license and its terms in the right sidebar.
2 min read
1. Open the home page
Open the repository. In the right sidebar, under About, find the License section.

2. Read the terms
The License section shows:
- The name of the license, and one sentence about it.
- Up to three lists of terms (see the table below).
- Read the license: a link to the license file.
- The note "This is not legal advice."
| List | What it tells you |
|---|---|
| Permits | What you can do, for example commercial use and modification. |
| Requires | What you must do, for example keep the license and copyright notice. |
| Forbids | What the license does not give you, for example liability and warranty. |
- If the text is not a known license, the section shows Other license and the link only.
- If the repository has no license file, the sidebar has no License section.
Done
You know what the license lets you do, what it asks of you, and where to read its full text.
Get your license recognized
The known licenses are the choosealicense.com licenses that GitHub also uses. To show the terms of your license on the home page of your repository:
- Put the license file at the root of the repository.
- Give it one of these names:
LICENSE,LICENCE,COPYING, orUNLICENSE. Uppercase and lowercase are the same. - Use no extension, or
.md, or.txt. For example,LICENSE.mdis correct. - Keep the license text unchanged. Do not add a heading or other text above it.
The year and the name of the copyright holder can be any text. The License section then shows the name and the terms of your license.
To start a new repository with a license, see Start a repository with a .gitignore and a license.