How to Validate Cargo.toml Files - Step by Step Guide
The rules come from the Cargo manifest reference and the dependency specification. For plain TOML files that aren't Cargo manifests, use the TOML Validator.
Paste or upload your Cargo.toml
Paste the manifest into the editor, upload the Cargo.toml file from your project, or click Sample to load a small crate manifest.
Let it check the manifest
About half a second after you stop typing, the file is read as TOML 1.0 and then checked against the rules Cargo applies: package name, version, edition, dependency entries and target sections.
Read the errors and warnings
Errors (red) are things Cargo itself would refuse. Warnings (yellow) are things Cargo accepts but crates.io would refuse to publish, or that make Cargo print a warning. Each one names the field it is about.
Fix and copy the report
Edit the manifest in place and the results update. Copy puts every error and warning, with field names and line numbers, on your clipboard for an issue or a pull request.
Frequently Asked Questions
What does this validator check in a Cargo.toml?
First the TOML itself: unquoted text, a key defined twice, a missing equals sign or an unclosed string is reported with its line and column. Then the Cargo rules: the package name (no leading digit, no spaces or symbols), a version that is real semver such as 1.0.0, an edition of 2015, 2018, 2021 or 2024, dependency entries that Cargo can resolve (a version requirement, a path, git or workspace = true), and [[bin]], [[test]], [[bench]] and [[example]] entries that have a name.
Which fields are required in Cargo.toml?
Only name, inside [package]. Since Rust 1.75 version can be left out (Cargo then uses 0.0.0 and won't publish the crate), and a missing edition means edition 2015 plus a warning from Cargo. A workspace root with only a [workspace] section and no [package] is valid too. To publish on crates.io you also need description and license (or license-file), so those show up as warnings unless the package has publish = false.
How should dependencies be written?
A plain version requirement like serde = "1.0", or a table such as tokio = { version = "1", features = ["full"] }, a local crate with path = "../my-lib", a git source with git = "https://github.com/...", or serde = { workspace = true } in a workspace member. The validator flags entries Cargo can't use: a table with only features and no version, path or git, a version that isn't a valid requirement (like "abc" or "1.0.0.0"), a number instead of a string, or more than one of branch, tag and rev.
What is the difference between an error and a warning here?
An error means Cargo would stop with "failed to parse manifest" on this file. A warning means Cargo would build it, but crates.io would reject it on publish (no description, more than 5 keywords, a name longer than 64 characters) or Cargo would print a warning, for example when no edition is set.
Does a valid result mean cargo build will work?
It means the manifest itself is in order. The validator doesn't download anything, so it can't tell whether a crate version exists on crates.io, whether a path or git repository is really there, or whether a feature name is defined. Cargo checks those when it resolves dependencies.
Is my Cargo.toml sent anywhere?
No. The checks run in your browser and the file is not uploaded to a server or kept after you leave the page. Reload and the editor starts empty.
Related Tools
Rust Formatter
Format and beautify Rust code with proper indentation
Rust Validator
Validate Rust syntax and catch common errors
Cargo.toml Generator
Generate Cargo.toml files for Rust projects with dependencies
Rust Minifier
Minify Rust code by removing comments and whitespace
Rust Test Generator
Generate unit test templates for Rust functions
TOML to Go
Convert TOML configuration to Go config structs