JSON ⇄ YAML
Converts either way, preserving key order and choosing block or flow style for the YAML side.
Converts between YAML, JSON and TOML in any direction, in the browser. The parsers are written for this site rather than pulled from npm, which is why the page can list exactly what it refuses — anchors, tags, multi-document streams — instead of mis-reading them quietly.
Input
Drop a .yaml, .json or .toml file
Read in this tab. Nothing is uploaded.
JSON out
Written here rather than pulled from npm, which means the subset is chosen rather than inherited. Anything on this list is refused by name instead of being mis-read.
How to use it
Paste the config
The format is detected from the text, and the label under the picker says which one it decided on. Override it if the guess is wrong — a JSON file is also valid YAML, so a `{ }` document can go either way.
Pick the target
YAML for a Kubernetes manifest or a CI file, JSON for anything that gets parsed by a program, TOML for a Rust or Python project file.
Read the warnings, not just the output
A conversion that succeeded can still have changed meaning — a `null` dropped on the way into TOML, a `yes` read as the string it is under YAML 1.2. Those appear in a note under the output rather than being hidden.
Open the scope list when something is refused
The collapsed section at the bottom names every construct these parsers do not handle, and why. A refusal points at that list instead of failing with a parser error you would have to interpret.
Common questions
Why are my anchors and aliases refused?
Because expanding `*base` correctly means implementing YAML’s merge semantics, and getting that subtly wrong produces a file that looks right and deploys something else. Expanding them by hand before pasting is reliable; this guessing is not. The same reason covers `<<: *base`.
Why did `yes` become a string?
Because YAML 1.2’s core schema says it is one — only `true` and `false` are booleans. YAML 1.1 parsers, including some still in production, read it as a boolean. The difference is announced in the warnings when it occurs, because it is exactly the kind of thing that changes a deploy.
What happens to a `null` on the way to TOML?
It is dropped and a warning says so. TOML has no null value at all, so the choices were to omit the key or to invent a placeholder, and inventing one would put a literal `"null"` string into somebody’s config.
Are comments preserved?
No. The conversion goes through a data model, and comments are not data — JSON has nowhere to put them at all. If you need the comments, the YAML and TOML formatters on this site re-indent in place and keep them.
Feed it from
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
YAML Formatter & Validator
Re-indents YAML consistently, validates it, and flags the tab and anchor mistakes that break parsers.
JSON ⇄ TOML
Converts between JSON and TOML, mapping nested objects onto table headers.
TOML Formatter & Validator
Formats and validates TOML, normalising table ordering and inline-table style.
Next
These accept what this tool produces, so the result can go straight in.
JSON Formatter & Validator
Pretty-prints, minifies and validates JSON, pointing at the exact line and column of a syntax error.
JSON Schema Validator
Validates a document against a JSON Schema and reports each failure with its instance path.
JSON ⇄ TOML
Converts between JSON and TOML, mapping nested objects onto table headers.
YAML Formatter & Validator
Re-indents YAML consistently, validates it, and flags the tab and anchor mistakes that break parsers.
Base64 Encoder & Decoder
Encodes and decodes Base64 and Base64URL for text or files, handling UTF-8 correctly.
curl to Code
Converts a curl command into fetch, axios, Python requests, Go, PHP or PowerShell.