Config File Converter
Convert between JSON, YAML and TOML and see exactly what gets lost. Nothing you enter is sent to a server.
Loading the tool…
User reviews
No reviews yet. If you’ve used this tool, be the first to leave one.
Config File Converter: complete guide
Walk through the steps and examples, or jump straight to the topic you need.
At a glance
- Formats handled
- JSON, YAML and TOML, converting between any two.
- Source format
- Detected automatically, and you can also choose it yourself.
- What it refuses
- YAML anchors (&), aliases (*), merge keys (<<), tags (!!) and multiple documents (---).
- Losses it reports
- Comments disappear, dates become text, and large integers may change value.
- TOML limits
- It can't hold an empty value (null), so the conversion is blocked with a reason.
- YAML support
- Indented structure, lists, inline lists and tables, and multi-line values (| and >).
- TOML support
- Tables, arrays of tables ([[ ]]), dotted names, inline tables and multi-line strings.
- Size
- Up to 200,000 characters. Nothing is sent to a server.
How to use Config File Converter
Paste your config
The format is detected automatically. If it detects it wrongly, choose the source format yourself.
Choose the format to convert to
Choose from JSON, YAML and TOML. The result appears as soon as you choose.
Check what is lost
If anything changes in the conversion, such as comments, dates or large numbers, it is shown in yellow text above the result. Decide whether you can use it as it is.
Take it with you
You can copy it or save it with the matching file extension. You can also move the result to the source and convert it to yet another format.
What it’s good for
A refusal is better than a wrong result
YAML anchors (&), aliases (*), merge keys (<<) and tags (!!) are syntax for pulling a value in from somewhere else. If they are unrolled carelessly, you get a config file that looks fine but has different real values. A config file is more dangerous because a mistake doesn't show right away. So when this tool meets that syntax, it doesn't guess and instead tells you what the problem is.
It doesn't hide what you lose
Comments can't be moved to the same place in any format, so they disappear. Dates and times are handled differently by each format, so they are carried over as text. Very large integers can't be held exactly by the browser, so their values may change. TOML can't hold an empty value (null) at all. When any of this happens, the tool writes next to the result what was lost.
Worked examples
YAML to JSON
server:
port: 8080
tags:
- web{
"server": {
"port": 8080,
"tags": ["web"]
}
}Syntax it can't handle
base: &b
a: 1
use: *bYAML anchors (&) and aliases (*) are not handled. Spell out the values and try again.What each format can hold
Swipe the table sideways to see the rest.
| Item | JSON | YAML / TOML |
|---|---|---|
| Comments | Can't hold them | YAML and TOML both can, but they are lost in conversion |
| Empty value (null) | Allowed | Allowed in YAML, not in TOML |
| Date type | None (text) | TOML has its own date type |
| Large integers | Limited precision | Inherits the same limit |
When the result isn’t what you expected
It refused because I use anchors
Spell out the parts where you reused values with & and *. Unrolling them automatically could change the original meaning, so the tool blocks it on purpose.
It says it can't convert to TOML
It may contain an empty value (null), or the outermost level may be an array. TOML can't hold either. It also tells you which name is the problem.
A number changed
An integer longer than 16 digits can't be held exactly by the browser. If you need the exact value, wrap it in quotes and treat it as text.
It says the indentation is off
It tells you which line. YAML can't use tabs, so replace them with spaces.
Key terms
- YAML anchors and aliases
- Syntax for pulling in a value written in one place and using it somewhere else.
- TOML array of tables
- A way to write several items of the same shape using [[name]].
- Safe integer
- The range of integers JavaScript can hold exactly.
- Inline table
- A group written on one line, like { x = 1, y = 2 }.
Config File Converter FAQ
Do comments disappear?
Yes. JSON can't hold comments, and there is no way to know where a comment should go after conversion. If there are comments, you are told before converting.
Can it handle all YAML?
No. It handles widely used syntax, and does not handle anchors, aliases, merge keys, tags or multiple documents. For such files it tells you why, so spell out that part and try again.
Is my config uploaded to a server?
No. It is converted only inside this browser. You can paste a config that contains connection details as it is.
Why does it refuse some files outright?
A mistake in a config file doesn't show right away. Using a wrongly converted file as it is becomes a problem that is hard to find later, so when the tool isn't sure, it chooses not to convert.
Is there no way to keep comments?
No. JSON can't hold comments, and even in a format that can, there is no way to know which line a comment should go on after conversion. Instead, you are told in advance if there are comments.
Can I convert the result again?
Yes. Click "Use result as source" and the result moves to the left so you can convert it to another format.