This JSON ⇄ YAML ⇄ TOML converter converts between all three formats in
either direction, and reports the exact line and column when the input doesn't parse —
instead of a vague "invalid syntax" message. Runs entirely in your browser.
How to use it
Pick the input format, paste your data, pick the output format, and click "Convert". If the
input fails to parse, the error message tells you exactly which line and column to look at.
How exact error locations work for JSON
Browsers don't consistently expose a line/column for JSON parse errors — some don't report a
position at all. This tool runs its own minimal scan over the JSON grammar whenever
JSON.parse fails, walking the same structure a real parser would, just far
enough to find and report exactly where it breaks.
What doesn't round-trip perfectly
TOML has no native representation for a bare top-level array or a null value, and YAML's
comments and anchors have no JSON or TOML equivalent — converting away from YAML or TOML
and back will preserve the data but not those format-specific extras.
Frequently asked questions
Why does the error message give a line and column?
Because "invalid JSON" on a 200-line config file is nearly useless on its own. This tool pinpoints exactly where parsing failed, the same way your editor's linter would, so you don't have to scan the whole file by eye.
Why doesn't this just show JavaScript's native JSON.parse error?
Native JSON.parse error messages are inconsistent — different browser engines (and even different versions of the same engine) format them differently, and some don't include a position at all. This tool runs its own lightweight position-tracking scan whenever parsing fails, so the line and column are accurate and consistent regardless of which browser you're using.
Does converting to YAML or TOML lose any data?
All three formats can represent the same core data shapes (objects/maps, arrays/lists, strings, numbers, booleans, null), so a round trip between them is lossless for typical config data. TOML has no direct equivalent for a bare top-level array or null value, so those specific edge cases may need adjusting by hand.
What libraries power the YAML and TOML parsing?
js-yaml and smol-toml, two independently maintained, widely used parsers — chosen over a hand-rolled parser because getting a full YAML or TOML grammar exactly right (indentation rules, anchors, multi-line strings, and so on) is exactly the kind of thing worth not reinventing.
Is my data sent anywhere?
No. Parsing and conversion both happen entirely in your browser via JavaScript — nothing is transmitted, logged, or stored.