DevTools Logo

SBOM Generator (CycloneDX & SPDX)

SBOM Generator (CycloneDX & SPDX)

Turn a lockfile into a valid CycloneDX 1.5 or SPDX JSON SBOM — every package stays in your browser.

Runs in your browser
Try an example

Lockfile or package list

Paste or drop a package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock or name@version list. Parsing is local — lockfiles are never uploaded.

CycloneDX 1.5

Paste a lockfile to generate an SBOM

Try one of the sample lockfiles above. Nothing leaves your browser.

Examples

npm lockfile to CycloneDX

Input
{
  "name": "shop-api",
  "version": "1.4.0",
  "lockfileVersion": 3,
  "packages": {
    "": { "name": "shop-api", "version": "1.4.0" },
    "node_modules/lodash": { "version": "4.17.21", "license": "MIT", "integrity": "sha512-…" }
  }
}
Output
{
  "bomFormat": "CycloneDX",
  "specVersion": "1.5",
  "serialNumber": "urn:uuid:…",
  "metadata": { "component": { "name": "shop-api", "version": "1.4.0" } },
  "components": [{ "name": "lodash", "version": "4.17.21", "purl": "pkg:npm/lodash@4.17.21", "licenses": [{ "license": { "id": "MIT" } }], "hashes": [{ "alg": "SHA-512", "content": "bf6903…" }] }]
}

The root object becomes metadata.component and the integrity base64 becomes a lowercase SHA-512 hex digest, as the CycloneDX schema requires.

Scoped package purl

Input
npm key: node_modules/@scope/tool@2.0.1
Output
pkg:npm/%40scope/tool@2.0.1

Package URL percent-encodes the @ that starts an npm scope. Writing pkg:npm/@scope/... looks intuitive but is not canonical and strict parsers will reject or rewrite it.

Poetry dev dependency

Input
[[package]]
name = "pytest"
version = "8.1.1"
category = "dev"
Output
{ "purl": "pkg:pypi/pytest@8.1.1", "scope": "optional" }  (CycloneDX)
comment: "Development dependency"  (SPDX 2.3)

Dev flags from the lockfile are preserved. Turn on Production only to drop these packages from the generated document entirely.

About this tool

SBOM Generator turns a dependency lockfile into a software bill of materials in CycloneDX 1.5, SPDX 2.3 or SPDX 3.0 JSON-LD form. It reads npm package-lock.json (v1/v2/v3), yarn.lock v1, pnpm-lock.yaml v6/v9, poetry.lock and plain name@version lists, detecting the format structurally with a manual override available when a file is unusual.

Every dependency is emitted with its name, version and package URL (purl). Integrity hashes are converted from the lockfile's base64 or hex form to the digest encoding each schema expects: SHA-512 / SHA-256 / SHA-1 in CycloneDX and SHA512 / SHA256 / SHA1 in SPDX. Resolved registry URLs become CycloneDX externalReferences and SPDX downloadLocation. The npm root package (or a pasted package.json name and version) becomes metadata.component / the described SPDX package.

Licenses are never guessed. A declared SPDX identifier stays an identifier, an SPDX expression such as MIT OR Apache-2.0 stays an expression, and anything else is recorded as a license name or NOASSERTION with a warning. No registry call is made and no lockfile is uploaded: the entire conversion, validation, preview and download happen in the browser tab.

What this tool does not do

  • Only npm, PyPI and generic purls are produced; Go, Ruby and Java ecosystems are not parsed.
  • Yarn Berry (v2+) lockfiles are not supported; yarn.lock v1 and a plain list are.
  • Licenses are never inferred from a registry: missing declarations remain NOASSERTION.
  • SPDX 3.0 output is a best-effort JSON-LD rendering, not a certified profile implementation.
  • Dependency graphs are not emitted; components are a flat inventory even when the lockfile encodes nesting.
  • The in-page preview is capped at 200 components; copy and download are complete.
  • Container images, files and vulnerability data are outside the scope of this tool.

How to use this tool

  1. Paste or drop a lockfile

    Use one of the sample buttons or drop a package-lock.json, yarn.lock, pnpm-lock.yaml, poetry.lock or a name@version list onto the input pane. The detected format badge appears immediately.

  2. Choose the output standard

    Pick CycloneDX 1.5, SPDX 2.3 or SPDX 3.0 in the labeled format radiogroup. The JSON re-serializes from the same parsed component model.

  3. Set options

    Keep or omit hashes and development dependencies, choose pretty-printing, set the plain-list ecosystem, and optionally override the root component name and version.

  4. Validate and export

    Read the stats bar and schema-check result, expand the checklist if needed, then copy the JSON or download bom.cdx.json / bom.spdx.json / bom.spdx3.json.

Use cases

Customer security questionnaire

Attach a CycloneDX JSON file with every shipped dependency, its purl and its integrity hash instead of hand-writing a spreadsheet.

Procurement SBOM requirement

Standardize on SPDX 2.3 across repositories, including document namespace, creation info and DESCRIBES relationships.

Release artifact

Publish a CycloneDX SBOM next to each release and keep the same inputs for reproducible builds; unique serials and timestamps still mark each generation.

Compliance review of license gaps

See exactly which components have a declared license and which remain NOASSERTION, with warnings for non-SPDX strings.

Supported inputs and outputs

FormatWhat is extracted
npm package-lock.jsonv3/v2 packages map (skipping the root and link: entries), with the last node_modules/ segment as the package name; v1 falls back to the nested dependencies tree.
yarn.lock v1Selector headers such as lodash@^4.17.21 are reduced to name and the indented version / resolved / integrity lines are read. Yarn Berry lockfiles need list mode.
pnpm-lock.yamlv9 name@version and v6 /name/version package keys are parsed with resolution.integrity; peer suffixes are stripped and devDependencies are marked optional.
poetry.lock[[package]] blocks become pkg:pypi components; sha256 file hashes are read and dev / optional packages can be filtered out.
name@version listOne package per line; choose the npm, PyPI or generic ecosystem. Scoped names and non-ASCII characters are preserved.
CycloneDX 1.5bomFormat, serialNumber URN, timestamp and tool metadata; components with purl, hashes, license choice objects, externalReferences and scope.
SPDX 2.3 / 3.0SPDXRef-DOCUMENT with name, namespace and creationInfo; packages with SPDXID, purl externalRefs / identifiers, checksums, NOASSERTION fields and a DESCRIBES relationship.

The SPDX 3.0 rendering is a best-effort JSON-LD representation of the same model; check it against your recipient's profile before publishing.

Common mistakes

Mistake:Expecting license names to be looked up from the registry.

Fix:The tool never contacts a registry. Only licenses declared in the lockfile are emitted; everything else stays NOASSERTION or a name with a warning.

Mistake:Treating the SPDX toggle as a field rename of CycloneDX.

Fix:SPDX 2.3 uses different shapes: documentNamespace, per-package SPDXID, licenseDeclared, filesAnalyzed, purl externalRefs and SPDX checksum algorithm names.

Mistake:Pasting a Yarn 2+ lockfile and expecting v1 parsing.

Fix:Yarn Berry uses a different YAML-based format. Use a plain name@version list for that project, or generate the SBOM with your package manager.

Mistake:Assuming an SBOM contains vulnerability findings.

Fix:An SBOM is the inventory, not a scan. Feed the generated file to an OSV/SCA scanner as the next step.

Mistake:Sharing a huge preview instead of the exported file.

Fix:The preview caps at 200 components by design; Copy and Download always use the complete document.

Frequently asked questions

What is an SBOM and who asks for it?

A software bill of materials is a machine-readable inventory of the components that make up a build: names, versions, package URLs, hashes and license information when available. Customers, procurement teams, regulators and critical-infrastructure guidance increasingly ask for one before accepting software. This tool produces that inventory from a lockfile you already have.

CycloneDX or SPDX — which should I use?

Use CycloneDX 1.5 when your recipient's tooling is SCA/vulnerability oriented or follows ECMA-424; it has first-class component hashes, scopes and external references. Use SPDX 2.3 when the request comes from a license-compliance workflow or an existing SPDX pipeline; it emphasizes document identity, declared licenses and relationships. The toggle re-serializes the same parsed components, so you can generate both and compare.

Why do licenses show NOASSERTION?

Lockfiles are not license databases. Many npm entries do carry a license field and that value is used verbatim; when the field is absent, there is no local evidence to rely on. The tool does not call a registry to fill the gap, because that would both send your dependency list off-device and let a guessed license enter a compliance document. Custom strings such as 'SEE LICENSE IN LICENSE' are kept as license names with a warning instead.

Is my lockfile uploaded?

No. Parsing, purl construction, license inspection, validation, preview and download all happen in this browser tab. There are no registry lookups or analytics payloads containing your packages. The lockfile text itself is not saved to local storage; only your last-used format and options are remembered.

What is a purl?

A package URL (purl) is a standardized identifier like pkg:npm/lodash@4.17.21 or pkg:pypi/requests@2.31.0. It lets SBOM consumers identify the same component across ecosystems without guessing from a name alone. Scoped npm names are percent-encoded: @scope/pkg becomes pkg:npm/%40scope/pkg@1.0.0.

Does the tool include development dependencies?

By default yes, because the lockfile contains them and an inventory should be honest about what is present. Dev and optional entries are marked (CycloneDX scope optional, an SPDX comment). Turn on Production only to omit them from the generated document, which is what many procurement questionnaires actually want.

Can I use this with Yarn 2 or pnpm 10?

pnpm lockfiles with a lockfileVersion header and packages/importers sections are supported, including v6 slash keys and v9 name@version keys. Yarn Berry (v2+) lockfiles are not; paste a name@version list instead. Unusual lockfiles should use the manual Input format selector, and a failed parse always leaves your input intact with an actionable error.

References & standards