Skip to main content
ConduitTools by ConduitCode Labs

Converters

JSON and YAML Converter

Turn JSON into readable YAML for config files, or YAML into JSON for an API. Values keep their type, and a mistake is reported with its line and column.

  • Free
  • No sign-up
  • Runs in your browser
Quick guide

How to use this tool

  1. Choose the direction, JSON to YAML or YAML to JSON, then type, paste or drop a file.

  2. Pick the Indent (2 spaces, 4 spaces, or Tab for JSON) and turn on Sort keys A to Z to put the keys in order. A mistake is reported with its line and column, and the tool tells you when the text looks like the other format.

  3. Check the result, then press Copy result or Download, or Use as input to convert it back again.

How to use this tool
  1. Choose the direction, JSON to YAML or YAML to JSON, then type, paste or drop a file.

  2. Pick the Indent (2 spaces, 4 spaces, or Tab for JSON) and turn on Sort keys A to Z to put the keys in order. A mistake is reported with its line and column, and the tool tells you when the text looks like the other format.

  3. Check the result, then press Copy result or Download, or Use as input to convert it back again.

Waiting for data
InputPaste JSON or YAML, or drop a file
ResultUpdates as you type
Nothing to convert yet

Paste JSON and choose JSON to YAML, or paste YAML and choose YAML to JSON.

0 BInput size
—Output size
What it handles

The same data, in the other format.

JSON is what APIs speak and YAML is what people write config in. Converting by hand goes wrong on quoting and indentation, so this does it for you and keeps every value as it was.

Both directions

JSON to YAML gives indented, comment-ready YAML. YAML to JSON gives formatted JSON with 2 spaces, 4 spaces or tabs, and can sort the keys A to Z.

Full YAML support

Anchors, aliases and merge keys are resolved, block text with | keeps its line breaks, and a file with several documents separated by --- becomes a list.

Values stay exact

Strings that look like other things, such as yes, no, 007 or 1:30, are quoted in the YAML so no parser turns them into something else. Large whole numbers keep every digit.

Frequently asked questions

Why are some values in quotes in the YAML?

Because unquoted they could be read as something else. The text no can be read as false, 0o17 as a number, and 2024-01-01 as a date, depending on the parser. Quotes keep them as the text you had.

What happens to comments in YAML?

JSON has no comments, so they are dropped when converting YAML to JSON. Going from JSON to YAML there are none to keep.

Can it convert a YAML file with several documents?

Yes. Documents separated by --- are converted to a JSON list, one item per document.

Are big numbers kept exactly?

Reading YAML, yes: a whole number such as 12345678901234567890 is written to JSON with every digit. Reading JSON, numbers beyond about 15 digits are rounded by the browser before this tool sees them, so keep long IDs as strings.

Why do I get an error for JSON that works elsewhere?

JSON is strict: keys need double quotes, and trailing commas and comments are not allowed. The error names the position of the first problem. If your text is YAML, the tool says so.

Keyboard shortcuts

CtrlK
Search all tools
/
Search the directory (on the homepage)
CtrlEnter
Copy or download the result
CtrlShiftEnter
Generate a new password or new text
?
Show this list
Esc
Close a dialog or menu