TOML Fixer

Automatically fix and repair broken TOML syntax

Input

Output

Paste your input on the left and press Fix TOML.

Or drop a file on this box, , or .

What is the TOML Fixer?

You hand-edit a `Cargo.toml`, save, run `cargo build`, and the parser yells at you about an unterminated string on line 47. We've all been there. This tool takes a broken TOML file, figures out what went wrong, and gives you back something the parser will actually accept. Paste it in, hit the button, copy the fixed version back into your repo. The format itself is defined by the TOML 1.0.0 spec: the fixer aims to produce output that round-trips through any compliant parser.

The most common breakage we see comes from manifest files: a stray quote in `[dependencies]`, a missing closing bracket on an inline table, or a header like `[server.production]` that got typed as `[server.production` with no closing brace. The fixer handles all of those. It works on any TOML: Cargo manifests, pyproject.toml (PEP 518), Hugo config, Black's configuration, or anything else built on the format.

Unlike the TOML formatter and validator, this page needs the network: pressing Fix posts your file to our repair service and waits for the corrected text. It is not stored afterwards, but it does leave your machine, so take out API tokens, database URLs and anything else secret from a .env-style config before you paste it.

How to Use the TOML Fixer

Three steps: paste, hit Fix, check what came back.

1

Paste Broken TOML or Load Sample

Drop your invalid TOML into the left editor. Hit Sample TOML if you want to see the kinds of breakage the fixer handles: the sample includes a missing quote, a header without a closing bracket, and a trailing comma in an inline table. Real-world example of the kind of input we see:

title = My Server
[server.production
port 8443
log_path = "/var/log/app.log"
allowed = ["a", "b",]

The fixer is asked to return output that follows the TOML 1.0 rules, so it should parse with toml-rs, tomli or go-toml. Check it with a validator before you commit.

2

Click Fix TOML!!

Press Fix TOML!!, the green button above the editors. The file goes to the repair endpoint on our backend, capped at 64 KB, and comes back with problems such as an unclosed header like [server.production, a string missing its closing quote, or a trailing comma inside an inline table corrected. While the request is out, the button is disabled and the right pane shows "Fixing TOML..." so a second click cannot send it twice.

3

Review Fixed Output

The right panel shows the repaired TOML. The repair is meant to leave values alone, but compare it with your original anyway, then copy it back into pyproject.toml, Cargo.toml or whatever you were editing. The TOML Validator will confirm it parses.

When You'd Actually Use This

Cargo.toml debugging

You added a dependency by hand, the version string got an extra quote, and now `cargo check` won't even start. Paste the manifest in, get a clean version back, keep shipping. The output stays compatible with whatever Rust toolchain you're running.

pyproject.toml fixes

Editing `[tool.black]` or `[tool.ruff]` and accidentally killing the `[build-system]` table is a classic. The fixer rebuilds the table headers and re-balances any inline tables that got truncated mid-edit.

Hugo and static-site config

Hugo's `config.toml` has nested tables that are easy to get wrong, especially after copy-pasting from a tutorial. The fixer normalises the headers and lets you ship without staring at line numbers.

Recovering pasted snippets

TOML pasted out of Slack, GitHub issues, or chat clients sometimes loses quotes or picks up smart-quote characters. Run it through the fixer and you get back ASCII-clean TOML that any parser will accept.

Common Questions

Is my TOML sent anywhere or stored?

No, we don't store it, but it does leave your browser: the fix runs on our server, and the result is sent straight back. Don't paste configs with live credentials in them; replace tokens and passwords with placeholders first.

What kinds of errors can it actually fix?

Missing or unbalanced quotes around strings, broken table headers (`[server.production` with no closing bracket), unterminated inline tables, trailing commas where TOML doesn't want them, smart-quote characters that snuck in from a copy-paste, and inconsistent indentation inside arrays. The format rules it follows match the TOML 1.0 specification.

Does it preserve my values?

It's meant to. The repair fixes structure only and keeps strings, numbers, booleans and datetimes as you wrote them, so "1.2.3" should stay a quoted string. That isn't guaranteed on every input, though, so diff the result against your input before you commit it.

What if the TOML is too broken to fix?

If the structure is genuinely beyond saving (say the whole file is one long unterminated string), you'll get an error or a partial repair. Fix the worst spot by hand and run it again; the second pass usually gets the rest.

Will the fixed output work with my parser?

It should, since the fixer aims for TOML 1.0 output, which toml-rs, tomli/tomllib in Python 3.11+ and go-toml all read. Because the text is rewritten rather than parsed, check it: paste it into the TOML Validator or load it with your own parser.

Can I use it on really large files?

There's a 64 KB limit on input. That's plenty for any sane Cargo.toml or pyproject.toml, if you're hitting that ceiling, your config has bigger problems than syntax errors.

Other TOML Tools You Might Need

Fixing broken TOML is one piece. Here are the others that pair with it: