fjordtools / Convert / YAML JSON TOML

YAML ⇄ JSON ⇄ TOML Converter

Convert YAML, JSON and TOML in your browser. The input format is detected, big numbers and key order are kept, and errors name the line. Files never leave your device.

Input
YAML

      
About YAML JSON TOMLhow it works and good to know

Convert config between JSON, YAML and TOML

Paste a Kubernetes manifest, a docker-compose.yml, a pyproject.toml, a Cargo.toml or an API response and get the same data in another format. The format of the input is detected for you, or you can choose it. Errors name the line and column.

What stays the same, and what can change

Keys keep their order and numbers keep every digit, so 12345678901234567890 is not rounded. Comments are not data and are dropped. YAML anchors and aliases are expanded, and << merge keys are applied. TOML dates and times become strings, because JSON has no date type. TOML writes plain keys before tables, so key order can change there.

What cannot be converted, and why

TOML has no null, so a JSON or YAML null is reported with its path instead of being silently dropped, and a TOML file needs an object at the top. YAML .inf and .nan, TOML inf and nan, YAML files with several documents, and YAML tags other than !!str, !!int, !!float, !!bool and !!null are refused with a clear message. YAML reads the 1.2 rules, so yes, no, on and off are text, not booleans; when the converter writes such a string it adds quotes so any YAML reader gets the same value.

How it is tested

The YAML and TOML readers are checked against PyYAML and Python's tomllib on thousands of generated and deliberately damaged documents: they must accept and reject the same input and read the same data. Everything the converter writes is read back by those same libraries.

Privacy

Your files are converted in your browser. They are not uploaded or stored, which matters for configs that contain hostnames, keys or tokens.

Related tools