JSON ↔ YAML ↔ TOML Converter
Convert between JSON, YAML and TOML with instant validation and clear error lines.
service: "forg-gateway" port: 8787 debug: false regions: - "us-east" - "eu-west" limits: rpm: 600 burst: 50
YAML & TOML support a documented common subset (nested maps, lists, scalars). Anchors, block scalars, multi-doc streams, inline tables and date-times are rejected with a clear error — never silently mangled. Comments are not preserved. TOML has no null; nulls emit as empty strings.
How it works
Configuration moves between formats constantly: a CI pipeline wants YAML, a Rust or Python tool wants TOML, an API wants JSON. This converter takes whichever you paste — the source format is auto-detected, with a manual override — parses it into a neutral data model of maps, arrays and scalars, and re-emits it in the format you pick. Everything runs in your browser; config files often contain hostnames, internal paths and the occasional credential, so none of it should transit a server just to change syntax.
The parsers are intentionally small and intentionally honest. JSON uses the browser's native JSON.parse, which is the full spec. YAML and TOML are handled by purpose-built mini-parsers covering the common subset real config files use: nested maps, block lists, quoted and plain scalars for YAML; tables, key-value pairs, arrays and the basic scalar types for TOML. Exotic features — YAML anchors and aliases, multi-document streams, TOML date-times — are rejected with an explicit error instead of being half-converted. A converter that guesses is worse than one that refuses.
Error reporting is line-accurate. When parsing fails, the error gutter pins the message to the offending line number, so a stray tab or an unclosed quote in a 300-line file is a ten-second fix rather than a bisection exercise. The emitters guard against the classic footguns too: YAML output quotes any scalar that could be misread under YAML 1.1 rules (no, on, version-like strings such as 1.10), which is how the infamous Norway problem corrupts country codes in less careful tools.
Key order is preserved through the round trip, output is consistently indented at two spaces for YAML and standard table layout for TOML, and both copy and download buttons give you the result in one click. If you need to confirm two configs are semantically identical after converting, the Diff Checker's JSON mode compares structures while ignoring key order and formatting noise.
Frequently asked questions
Are comments preserved when converting?
No, and no converter can honestly promise this in general. JSON has no comment syntax at all, so any YAML or TOML comments are necessarily dropped on the way through. Conversions between YAML and TOML here go via a plain data model (objects, arrays, scalars), which also discards comments. If comments are documentation you need to keep, convert once and re-add them by hand in the target file.
What is the YAML 'Norway problem'?
In YAML 1.1, bare tokens like no, yes, on and off parse as booleans — so a country list containing the code NO silently becomes false. This bites config files constantly. The defense is to quote ambiguous strings, which this tool's emitter does automatically: any scalar that could be misread as a boolean, number or null is emitted with quotes so a round-trip preserves your data.
Is key ordering preserved?
Yes, in practice. JavaScript objects preserve string-key insertion order, and the parsers and emitters here all walk keys in that order, so the converted output keeps your original key sequence. Note that JSON, YAML and TOML specs all treat mappings as unordered, so tools downstream are allowed to reorder — never encode meaning in key order.
How large a file can I convert?
The converters are linear-time string processors, so multi-megabyte documents convert in well under a second on a modern laptop. Everything stays in browser memory — there is no upload, so there is no server-side size limit either. The textarea itself becomes the bottleneck before the parser does; for files beyond ~10 MB a command-line tool will be more comfortable.
Which YAML and TOML features are supported?
A deliberately documented common subset: nested maps, lists (block style), quoted and plain scalars for YAML; tables, dotted-free flat keys, arrays and basic scalar types for TOML. Anchors, aliases, multi-line block scalars, multi-document YAML streams, TOML inline-table nesting beyond one level and date-time types are not parsed — you get a clear error rather than silently wrong output.
Built by FORG — AI cost observability for agentic coding. Free tools, no signup, nothing leaves your browser.
Learn about FORG