TOML to JSON Schema converter
Convert TOML to JSON Schema: generate a schema from a sample TOML file such as Cargo.toml or pyproject.toml.
What you get
- Generate JSON Schema from TOML: a JSON Schema from TOML files such as Cargo.toml, pyproject.toml or app config.
- Use it in editors (for example with the Even Better TOML extension) for autocompletion and validation.
- Checked: your TOML data validates against the schema with Ajv.
- A TOML schema generator for any config, including a pyproject.toml schema for your project’s own settings.
- Private and free: everything runs in your browser, nothing is uploaded, and there is no sign-up.
How each result is checked
- Step 1: Your TOML is parsed with a TOML 1.0 parser; errors show the line number.
- Step 1: The JSON is parsed back and compared with the parsed TOML, value by value.
- Step 2: The generated schema is compiled with Ajv, the most widely used JSON Schema validator.
- Step 2: Your sample is validated against the generated schema. It must pass.
What can't convert exactly
- JSON has no date type, so TOML dates become ISO strings.
- Comments are not carried over.
- A schema inferred from one sample can only describe what the sample shows. Review required fields and enums before relying on it.
- Turn on "Top-level array = list of samples" to infer one schema from many records.
Questions
How is a two-step conversion checked?
Your input is converted to JSON first, then to the target format. Each step has its own independent check, and both must pass. The checks of both steps are listed under every result.
Is my data uploaded?
No. Everything runs in your browser, in a background worker. Nothing is sent to a server.
How do I convert TOML to JSON Schema online?
Paste your TOML or open a file on the left (or click Example). The JSON Schema appears on the right as you type, already checked. Copy it, or download it as a file. Nothing is uploaded.
Can the JSON Schema output be wrong?
Every result is checked before it is shown (the checks are listed on this page). If a check fails, the page says "Review needed" and why, instead of presenting the output as correct, and anything that cannot convert exactly is named in the notes.