About
Tool No. 31 of Pikkola
Configuration files come in four shapes and people keep moving between them: a Compose file becomes JSON for a test, an .env becomes TOML for a new tool, a wrangler.toml becomes a table someone can read. This studio is one page for that move.
What it does
- Reads YAML, JSON, TOML and .env, and writes any of the four. Six directions between different formats, plus reformatting the same one.
- Checks the text as it is typed. A tab used as indent, a block that does not line up, a quote that never closes, a table defined twice, a line without a value: each one is reported with a line and a column, and clicking it puts the cursor there.
- Formats the result: two or four spaces, keys sorted alphabetically or left in the order they appeared, and a copy or download button for whatever is on the right.
- Loads five examples to start from: Docker Compose, GitHub Actions,
wrangler.toml, an.envfile andpackage.json.
How it is built
There are four parsers and four writers. A parser reads its own syntax into one small data model: an ordered map for an object, an array for a list, and a string, number, boolean or null for everything else. A writer walks that model and prints its own format. Nothing is converted by searching and replacing text, which is why a colon inside a quoted string stays inside the string, and why an array in YAML becomes an array in JSON instead of a line with brackets in it.
The error positions come from the parser itself. Each parser keeps the index where it stopped, and the index is turned into a line and a column at the moment the error is shown. That is why the column for a tab used as indentation is the tab, not the start of the line.
The TOML reader keeps a date as a date, so a value written as 2026-11-18T09:00:00Z is printed back as a TOML date rather than quoted as a string. The YAML reader resolves anchors and aliases and reads block scalars. The JSON reader rejects what JSON itself rejects: a trailing comma, a comment, a key without quotes.
What it deliberately does not do
- It does not know your schema. A clean result means the file is well formed, not that Docker Compose, Wrangler or your application will accept the keys inside it.
- It does not keep comments. The document is rebuilt from values, and JSON has nowhere to put a comment anyway. Use a formatter of the same format if comments must survive.
- It does not merge documents. A YAML file with two
---documents is reported instead of silently taking one of them. - It does not interpret YAML merge keys (
<<) or custom tags, and it does not expand environment variables inside an.envvalue. - It does not send, store or count anything you paste. See Privacy.
Why it is free
Pikkola builds small, single purpose tools and keeps them free, with no account and no advertising. They run in the browser, so serving them costs almost nothing and there is no reason to charge for this one.
Contact
A file that should convert and does not, an error whose line number is wrong, or a format feature you need: hello@pikkola.com. A pasted fragment that produces a strange result is the most useful report there is.