01What is SPDX License Expression Checker?
The SPDX License Expression Checker validates the short license strings used in package manifests, source file headers and SBOMs. Examples are MIT, Apache-2.0 OR MIT, and GPL-2.0-only WITH Classpath-exception-2.0. A typo in one of these strings can break license scanners or hide a real obligation, so it pays to check them before you publish. The tool follows the grammar in the SPDX specification annex on license expressions. Here is how it works. First it splits your text into tokens: license IDs, operators and parentheses. Then a small parser builds a tree using the precedence rules from the spec. Finally it prints a normalized form, a list of the licenses found, any problems, and a plain English reading. The SPDX annex defines four operators. A trailing + means this version or any later one. WITH attaches an exception to a license. AND means you must meet every license. OR means you may pick one. Parentheses group terms. Precedence runs from + to WITH to AND to OR, so A OR B AND C means A OR (B AND C). The normalized output adds those parentheses so the grouping is plain to see. Each ID is compared with an embedded list of 65 common licenses and 15 exceptions. Their IDs and names were checked against the official SPDX license-list-data files. The checker reports syntax errors with a position, such as a missing operator, an unclosed parenthesis or a space before +. It flags an exception used where a license belongs, and a license used after WITH. It warns about deprecated IDs like GPL-2.0 and names the replacement, such as GPL-2.0-only. It also warns when + is added to an -only or -or-later ID, since those IDs already state the version range. It warns about lower case operators and IDs that differ in case from the canonical form, because SPDX matches IDs without regard to case. LicenseRef-, DocumentRef- and AdditionRef- custom identifiers are accepted. As a worked example, enter MIT OR Apache-2.0 AND BSD-3-Clause. The normalized form is MIT OR (Apache-2.0 AND BSD-3-Clause). The reading says "You may choose ONE of these", then lists the MIT License. Under it comes a nested "You must comply with ALL of these" group holding Apache License 2.0 and the BSD 3-Clause license. There are honest limits. The SPDX list has several hundred licenses and this tool only embeds common ones. A valid ID that is not in the embedded list shows a warning, not an error, so confirm it on spdx.org/licenses. The explanation covers the expression syntax only and is not legal advice. Everything runs in your browser.
Open source maintainers, package authors and compliance teams who write or review license metadata. The tool runs entirely in your browser, so your data never leaves your device.
02How to use SPDX License Expression Checker
- Paste or type the SPDX license expression into the input box.
- Read the status line to see whether the expression is valid.
- Fix any errors listed in red and review the warnings in amber.
- Check the normalized expression, which uses canonical IDs and explicit grouping.
- Read the plain English explanation and copy the normalized form if you need it.
03Worked examples
- Input:
MIT OR Apache-2.0 - Result:
Valid. Licenses: MIT, Apache-2.0. No issues. - A standard dual license. OR means the user may pick either one.
- Input:
GPL-2.0-only WITH Classpath-exception-2.0 - Result:
Valid. Licenses: GPL-2.0-only. No issues. - WITH attaches an exception to one license, so only GPL-2.0-only is counted as a license.
- Input:
(LGPL-2.1-or-later OR MPL-2.0) AND BSD-3-Clause - Result:
Valid. Normalized: (LGPL-2.1-or-later OR MPL-2.0) AND BSD-3-Clause. Licenses: LGPL-2.1-or-later, MPL-2.0, BSD-3-Clause. - Parentheses group the choice, and BSD-3-Clause applies in every case.
- Input:
Apache2 OR LicenseRef-Proprietary - Result:
Warning: "Apache2" is not in this tool's list of common IDs. Check it against the full SPDX License List - Apache2 is a common misspelling of Apache-2.0. LicenseRef- identifiers are accepted without a warning.
- Input:
(GPL-2.0 OR mit) AND MIT WITH Apache-2.0 - Result:
Error: Apache-2.0 is a license, not an exception. WITH takes an exception such as Classpath-exception-2.0. Warnings: GPL-2.0 is deprecated on the SPDX list; use GPL-2.0-only. "mit" matches MIT; SPDX IDs match case-insensitively but the canonical form is MIT - Normalized form: (GPL-2.0 OR MIT) AND MIT WITH Apache-2.0. One error and two warnings in a single expression.
04Common use cases
- Checking the license field in package.json, Cargo.toml or pyproject.toml before publishing
- Reviewing SPDX-License-Identifier headers in source files during a code review
- Replacing deprecated IDs like GPL-2.0+ with GPL-2.0-or-later in an SBOM
- Understanding what a dual or combined license expression asks of you
- Catching an exception such as LLVM-exception written as if it were a license
05Tips
- Prefer GPL-2.0-only or GPL-2.0-or-later over the deprecated GPL-2.0 and GPL-2.0+.
- Add parentheses when you mix AND and OR, so readers do not need to remember the precedence.
- Use LicenseRef-yourname for a license that is not on the SPDX list.
- WITH only takes exception IDs, such as Classpath-exception-2.0 or LLVM-exception.
06Related concepts
SPDX, License expression, SPDX-License-Identifier, SBOM, Dual licensing, License exception.
Frequently Asked Questions
What is SPDX License Expression Checker?
SPDX License Expression Checker is a free, browser-based developer tool on AIDToolStack. Free SPDX license expression checker. Validate AND, OR, WITH, + and parentheses, catch deprecated IDs and misused exceptions, and see what it means. It requires no installation or sign-up and works entirely in your browser.
Is SPDX License Expression Checker free to use?
Yes. No sign-up, no fees and no usage cap.
Does SPDX License Expression Checker store my data?
No. It runs in your browser; nothing is uploaded.