← All Tools

⚙️ TOML Formatter / Validator

Format and lightly validate TOML-style config files with section/key parsing, line-specific errors, warnings, and copyable debug summaries.

TOML checks

  • Parses standard-looking TOML sections, array sections, comments, and key/value pairs.
  • Sorts keys within sections for readable review while preserving section order.
  • Reports typed line errors for duplicate keys, missing values, unclosed strings, and unrecognized lines.
  • Warns about bare string values and unusual leading tabs so configs are easier to harden before API/MCP use.
Runs in your browser

TOML formatting runs locally in your browser. Shared links only include TOML input when you explicitly opt in.

What this tool does

TOML Formatter formats TOML configuration files and reports lightweight validation issues with line-specific errors.

Why it is useful

It helps developers clean pyproject.toml, Cargo.toml, config files, and structured settings before editing, documenting, or handing them to another tool.

How it works

The browser parses standard-looking TOML sections, array sections, comments, and key/value lines, then produces sorted readable output plus a deterministic report.

Best input

Paste complete TOML with sections and key-value pairs. Keep advanced multiline strings and tool-specific semantics for your target parser.

Config tip

After formatting, run the target tool because config semantics depend on that tool as well as TOML syntax.

Privacy note

Formatting happens locally in your browser.

Important limitation

This lightweight formatter does not replace a full TOML parser or guarantee the consuming application accepts the configuration.

Quick answers

What uses TOML?

Python, Rust, static-site tools, and many CLIs use TOML for configuration.

Can comments be preserved?

Full-line comments are preserved; inline comments are kept after values when they are simple.

API examples

Call the same deterministic core through Utilito’s compact API router. Send only data you intentionally submit to the server-side endpoint.

Try in API playground →Schema →
Format TOML with curl
curl
curl -X POST https://utilito.dev/api/run \
  -H "Content-Type: application/json" \
  -d '{"tool_id":"toml-formatter","input":{"input":"name = \"utilito\"\nprivate = true","action":"format"}}'
Format TOML from JavaScript
javascript
const res = await fetch('https://utilito.dev/api/run', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    tool_id: 'toml-formatter',
    input: { input: 'name = "utilito"\nprivate = true', action: 'format' }
  })
});
const data = await res.json();
console.log(data.result.output || data.result.report);
Format TOML from Python
python
import requests
payload = {
    "tool_id": "toml-formatter",
    "input": {"input": "name = \"utilito\"\nprivate = true", "action": "format"},
}
result = requests.post("https://utilito.dev/api/run", json=payload).json()["result"]
print(result.get("output") or result.get("report"))

Common Use Cases

Clean pyproject.toml snippets

Format Python package config before pasting it into docs, PRs, or issue comments.

Review Cargo.toml changes

Sort keys and spot duplicate entries or missing values before committing Rust config changes.

Prepare app config for agents

Use the copyable JSON summary to hand parser status and line errors to an agent or CI helper.

Config Formatter Workbench workflow

Move between JSON, YAML, TOML, XML, config conversion, JSON path inspection, and schema validation while keeping snippets local to the browser.

{}JSON Formatter🧾YAML Formatter / Validator🧾XML Formatter⚙️Config Format Converter🎯JSON Path TesterJSON Schema Validator
View all in Code →