TOML to Types

Infer nested types from a TOML document and emit code for many languages. Output is illustrative — review before production use.

Parsing and conversion on this page run in your browser.

Generated code is a sketch from the sample shape. Dates become strings; mixed arrays may become unknown / Any / object.

All templates

Output types.ts

How to use

Example

[package]
name = "demo-lib"
version = "0.1.0"
edition = "2021"
description = "Sample library manifest"
license = "MIT"

[dependencies]
serde = "1"

[features]
default = ["std"]
std = []

FAQ

Is the code production-ready?

No. Treat it as a starting point. Nested names are inferred from keys and may need renaming.

Which languages are supported?

TypeScript, Zod, Rust, Python, Go, Kotlin, Java, C#, PHP, Swift, and JSON Schema.

Related tools