Skip to content
BENIBIX Learn

SPDX License Identifier

Development🚀 Product & ReleasesSoftware Licenses

Also known as SPDX, SPDX-License-Identifier, SPDX ID, License Identifier

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

Think of it like

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

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.

Why it matters

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

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 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.
SPDX IDs in a package file and a file header, read by a tool.

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.

Key takeaways

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