Convert between YAML, JSON & TOML in your browser.
Free online converter and formatter for YAML, JSON, and TOML. Pick any pair, paste, and convert. Works for OpenAPI specs, Kubernetes manifests, GitHub Actions, and Cargo/pyproject configs.
Any of 6 directionsPretty-printedLocal — no upload
Indent:
YAML input
Paste your YAML — Kubernetes, OpenAPI, GitHub Actions, anything valid.
JSON is what machines speak: strict, predictable, every key in double quotes. It's the right format for APIs, config files consumed by code, and anywhere whitespace can't be trusted.
YAML is what humans prefer to write: comments, multi-line strings, no curly brace soup. It's why Kubernetes manifests, GitHub Actions workflows, OpenAPI specs, and Ansible playbooks all use YAML — they live in version control and are read by humans more often than machines.
TOML is the format Rust (Cargo.toml) and Python packaging (pyproject.toml) standardized on: explicit tables ([section]) instead of YAML's significant whitespace, which makes it harder to accidentally break with an indentation mistake.
When to convert
YAML → JSON: you have a Kubernetes manifest, OpenAPI spec, or CI workflow and need to feed it to a tool that only accepts JSON.
JSON → YAML: an API returned JSON and you want to commit a readable version into your repo, or you're migrating a config from JSON to a YAML-native tool.
YAML/JSON → TOML: porting a config into a Rust or Python project that expects Cargo.toml/pyproject.toml-style TOML.
Format / pretty-print: paste in messy YAML, minified JSON, or TOML, and the converter re-indents the output cleanly.
Privacy
Everything runs in your browser. Your document never leaves your machine — there's no server round-trip, no analytics on the payload, no cookies set. Safe for secrets-adjacent configs (still: don't paste real secrets anywhere you don't control).
Frequently asked questions
How do I convert YAML to JSON?
Paste your YAML into the input box on the left with "YAML" selected as the From format and "JSON" as the To format. The converter parses it and pretty-prints valid JSON on the right, which you can copy or download as a .json file.
How do I convert JSON to YAML?
Select "JSON" as the From format and "YAML" as the To format, then paste your JSON. The output uses block-style YAML (no inline flow collections) at your chosen indent width, which is the format most config files and CI workflows expect.
Does this tool convert to or from TOML?
Yes. Pick "TOML" as either the From or To format to convert YAML ↔ TOML or JSON ↔ TOML directly — useful for projects that keep a Cargo.toml, pyproject.toml, or similar TOML config alongside YAML or JSON files and need one translated into the other.
Why would I need to convert YAML or JSON to TOML?
TOML is the config format Rust (Cargo.toml), Python packaging (pyproject.toml), and a growing number of CLI tools standardize on. If you're porting a Kubernetes-style YAML config or a JSON API response into one of those ecosystems, converting it to TOML by hand is tedious and easy to get wrong — this does it in one step.
What YAML features are supported?
Standard YAML 1.2 as parsed by the `yaml` npm package: nested mappings and sequences, comments, anchors and aliases, multi-line strings (block scalars), and all the usual scalar types (strings, numbers, booleans, null). Anything a real Kubernetes manifest or GitHub Actions workflow uses will parse.
What TOML version does this support?
TOML v1.1.0, parsed and serialized with the `smol-toml` library, which passes the official toml-test compliance suite. That covers tables, arrays of tables, inline tables, and all TOML scalar and date/time types.
Will converting lose any data or change the structure?
No — the conversion is a direct structural mapping (parse the source format into a plain JavaScript object or array, then serialize that same structure into the target format). Keys, nesting, and value types are preserved. One caveat: YAML comments are not preserved when converting to JSON or TOML, since neither format has a comment syntax.
Can I upload a file instead of pasting?
Yes. Click Upload and pick a .yaml, .yml, .json, or .toml file — it's read and parsed entirely in your browser, and the From format switches automatically based on the file extension.
Is my data uploaded anywhere?
No. All parsing and conversion happens in your browser via JavaScript. Nothing is sent to a server, logged, or stored — you can confirm this by checking your browser's Network tab while converting.
Why does my JSON input fail to parse?
This tool requires strict JSON: double-quoted keys and string values, no trailing commas, and no comments. If you're pasting a JS object literal (single quotes, unquoted keys, trailing commas, // comments), fix those first — strict JSON is what every JSON.parse-based tool, including this one, expects.