Developer and Text Tools

Package URLs (purl) Explained: Write Them Right for SBOMs

Learn the purl format, the canonical rules per ecosystem, common mistakes, and how to turn package.json, go.mod or pom.xml into a clean purl list.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
Package URLs (purl) Explained: Write Them Right for SBOMs

One identifier for every package ecosystem

Each language has its own way of naming dependencies. npm has scopes, Maven has group and artifact identifiers, Debian packages belong to a distribution and an architecture, and Go modules are named by their import path. Security tools need to talk about all of them at once: a software bill of materials lists every component in a product, and a vulnerability database must say exactly which releases are affected. The package URL, or purl, solves this with one string shape that fits every ecosystem.

A purl has up to seven parts. It always begins with the scheme pkg and a type such as npm, pypi or maven. Then come an optional namespace, the name, an optional version, optional qualifiers written like query parameters, and an optional subpath after a hash sign. pkg:deb/debian/[email protected]?arch=amd64&distro=bookworm names one Debian build precisely.

Canonical form matters more than it looks

Two tools comparing purls usually compare strings. If one writes pkg:pypi/[email protected] and another writes pkg:pypi/[email protected], a naive comparison misses the match. The specification therefore defines a canonical form. The type is always lower case. Each type has its own rules: PyPI names are lower-cased with underscores turned into dashes, GitHub and Bitbucket owners and repositories are lower-cased, and the @ at the start of an npm scope is percent-encoded so it cannot be confused with the version separator. Qualifiers are sorted by key, keys are lower case, and empty values are dropped.

Most real bugs fall into a few patterns. A Maven purl without the groupId as namespace cannot be matched. A version range such as ^18.2.0 copied from package.json is not a version. A qualifier repeated twice makes the string invalid. A purl for a Debian package without the distro qualifier may match the wrong build.

Checking and building purls

Paste your purls into the Package URL (purl) Parser and Builder, one per line. Each line is marked valid, worth checking or invalid. Selecting a line shows the parsed parts, the canonical spelling and the findings. If a scanner reported no matches for components you know are affected, compare its purls with the canonical forms; a single upper-case letter is often the cause.

The builder is useful when you write purls by hand, for example for a vendored library or a container image in an SBOM. Choose the type to see its namespace rule and an example, fill in the fields and add qualifiers such as arch, classifier or repository_url with one tap. The purl is checked as you type.

From a manifest to a purl list

Manifests describe what you asked for; lock files describe what you got. Converting package.json gives purls only for dependencies pinned to an exact version, because ranges cannot become purls. That is why the converter marks range entries and leaves out their version. For a complete and exact list, use package-lock.json, Cargo.lock in its own tooling, Gemfile.lock or the resolved output of your build. Maven POM files often use property placeholders for versions; these are left out with a note rather than guessed.

The export formats cover the common next steps: a plain text list to paste into a vulnerability lookup, a CSV to review with your team, and a CycloneDX components array to merge into an existing bill of materials.

Where purls fit in your process

Treat purls as the join key between your inventory and the outside world. Generate them during the build, store them with each release, and use the same canonical form everywhere. When a new advisory appears, a purl lookup tells you within minutes whether a product ships the affected package. The tool helps you get the strings right; complete dependency discovery still belongs to your build system or a dedicated SBOM generator.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages