# SPDX License Identifier

> A short, fixed name for a license, like MIT or Apache-2.0, that tools can read.

**Field:** Software Development  
**Category:** Product & Releases  
**Also known as:** SPDX, SPDX-License-Identifier, SPDX ID, License Identifier

## Think of it like

It is like a short code on a food box. A scanner reads it and knows what is in it.

## Definition

An SPDX license identifier is a short, fixed name for a software license, like MIT or Apache-2.0. It comes from the SPDX License List, a shared list of common licenses. You write it in a package file or at the top of each code file. Tools then read it to list every license in a project. GPL-3.0-only and GPL-3.0-or-later are two different names, so get the exact one.

## Example

Lucy's company must list every license in its app. A tool reads the SPDX IDs in 900 packages and makes the list in seconds.

## Example code

```javascript
// SPDX-License-Identifier: Apache-2.0
export function add(a, b) { return a + b; }
```

One comment line at the top tells tools this file is under Apache 2.0.

## Why it matters

Big apps use hundreds of packages. Exact, short names let a tool check them all for license problems.

## Common mistake

Writing a loose name like GPL or Apache. Use the exact ID, such as GPL-3.0-only, so nothing is left to guess.

## Three principles

- **Exact names.** One fixed ID per license.
- **Machine-readable.** Tools can scan them at once.
- **In every file.** One comment line at the top.

## Related terms

- [Software License](https://learn.benibix.com/term/development/software-license)
- [package.json](https://learn.benibix.com/term/development/package-json)
- [MIT License](https://learn.benibix.com/term/development/mit-license)
- [Apache License 2.0](https://learn.benibix.com/term/development/apache-license)
- [Dependency](https://learn.benibix.com/term/development/dependency)

![Three panels. Dual licensing: one codebase with two arrows, one to a free GPL copy and one to a paid commercial licence. Contributor licence agreement: a contributor signs before the code is merged, so the owner holds the rights it needs. SPDX identifier: a package.json line, license: MIT, and a file header, SPDX-License-Identifier: Apache-2.0, read by a scanning tool. A note under the first panel says source-available code can be read but not used freely.](https://learn.benibix.com/diagrams/dev5-license-models.svg)

---

Source: https://learn.benibix.com/term/development/spdx-license-identifier
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
