Package URL (purl) parser and builder
Parse a Package URL into type, namespace, name, version, qualifiers and subpath, check it against the purl spec, or build a canonical purl from its parts.
Everything you type here stays in your browser. Nothing is sent to HardenKit or to anyone else.
How to use the package URL (purl) parser and builder
- Choose “Parse a purl” and paste a Package URL, or load the example.
- Read the parts, and copy the canonical form if it differs from your input.
- To create one, choose “Build a purl” and fill in the type and the name.
- Add the namespace, version, qualifiers and subpath where they apply, and copy the result.
About this tool
A Package URL, or purl, names a software package in one string, whatever ecosystem it comes from: pkg:npm/%40angular/[email protected], pkg:pypi/[email protected], pkg:maven/org.apache.logging.log4j/[email protected]. SBOM formats such as CycloneDX and SPDX use purls to identify components, and vulnerability databases such as OSV accept them in queries, so a purl is often what connects an inventory to an advisory.
The format is pkg:type/namespace/name@version?qualifiers#subpath. Only the type and the name are required. The namespace is an npm scope, a Maven group ID or a GitHub owner. Qualifiers carry extras such as arch or repository_url, and the subpath points inside the package. Each part is percent-encoded on its own, which is why the @ of an npm scope is written %40.
Tools compare purls as strings, so a purl that is valid but not canonical can fail to match: PyPI names are lower case with dashes, qualifiers are sorted by key, and the type is lower case. This tool parses by the steps of the specification and prints the canonical form. The usual mistakes are a scope written with a raw @, a Maven purl without its group ID, and a missing version.
Sources
Questions
It identifies a package the same way across tools. Scanners write purls into SBOMs, vulnerability databases index advisories by them, and policy tools match on them. One string replaces the mix of names, coordinates and URLs each ecosystem uses on its own.
In a purl an unencoded @ separates the name from the version. The scope @angular is the namespace, so its @ is data and is percent-encoded: pkg:npm/%40angular/[email protected]. This parser also accepts the raw form and shows the canonical one.
A CPE names a product as vendor and product, the way the NVD catalogs it, and often has to be guessed for open-source packages. A purl names the package as its own ecosystem does, so it can be derived from a lockfile without guessing. Many SBOMs carry both.
The specification lists the known types, among them npm, pypi, maven, golang, gem, cargo, composer, nuget, docker, oci, deb, rpm, apk, github and generic. Each type has its own rules for the namespace and for upper and lower case. This tool applies the lower-case rules of the common types.