# TOML ↔ JSON Converter

> Convert TOML to JSON and JSON to TOML, instantly in your browser. Useful for pyproject.toml, Cargo.toml, and any modern config file. Free, no upload.

URL: https://uttir.com/toml-json-converter
Categories: data-tools, developer-tools
Privacy: Conversion runs locally in your browser. Your config never leaves the page.

## About

TOML (Tom's Obvious Minimal Language) is the configuration format you will find in pyproject.toml, Cargo.toml, and many other modern config files. It is designed to be easy to read and unambiguous — there is exactly one way to write any value.

This tool converts between TOML and JSON in both directions. JSON-to-TOML is useful when you have data in code and want a clean config file. TOML-to-JSON is useful when you want to inspect a TOML file as a tree, or feed it into a script that only accepts JSON.

## How to use

1. **Choose direction** — Toggle between TOML → JSON and JSON → TOML.
2. **Paste your input** — The output updates as you type. JSON-to-TOML expects a JSON object (or array) at the top level.
3. **Copy or download** — Use Copy to grab the converted text, or Download to save as a file.

## Examples

### pyproject.toml to JSON

A minimal Python project config.

Input:

```
[project]
name = "uttir"
version = "0.1.0"

[project.dependencies]
python = "^3.11"
```

Output:

```
{
  "project": {
    "name": "uttir",
    "version": "0.1.0",
    "dependencies": { "python": "^3.11" }
  }
}
```

### JSON to TOML

A small config object emitted as TOML.

Input:

```
{"name": "uttir", "version": "0.1.0", "private": true}
```

Output:

```
name = "uttir"
version = "0.1.0"
private = true
```

## FAQ

### What TOML features are supported?

Standard mappings, sequences, scalars (strings, numbers, booleans, dates as strings), inline tables, arrays of tables, and dotted keys. Heredocs, multi-line raw strings, and exotic table forms are not supported.

### Are dates preserved as dates?

No — TOML is the only mainstream format with typed dates. When you convert to JSON, dates become strings (ISO 8601). When you convert back to TOML, the strings round-trip as plain strings. If you need typed dates, keep the file in TOML.

### Can I convert arrays at the top level?

TOML requires a top-level table, so a bare JSON array cannot be converted to TOML directly. Wrap it in an object first: { "items": [...] }.

## Related tools

- [JSON to YAML Converter](https://uttir.com/json-to-yaml) — Convert JSON to clean YAML and decode YAML back to JSON. Round-trips common JSON shapes.
- [YAML to JSON Converter](https://uttir.com/yaml-to-json) — Parse YAML into structured JSON, instantly in your browser. Useful for reading Kubernetes manifests, GitHub Actions workflows, and any YAML config.
- [JSON Formatter](https://uttir.com/json-formatter) — Format, beautify, and validate JSON with adjustable indentation — instantly in your browser.
- [JSONPath Query](https://uttir.com/jsonpath) — Query any JSON document with JSONPath syntax — extract fields, filter arrays, count matches. A free, in-browser jq-lite for everyday JSON inspection.

---

For the full HTML page with the live tool, visit https://uttir.com/toml-json-converter.
This file is the markdown rendering at https://uttir.com/toml-json-converter.md. See https://uttir.com/llms.txt for a site-wide summary.
