SmartTechnology solutions for business

YAML and JSON Converter

Convert between the two formats, restrict unsafe types, and explain formatting that is not preserved.

Convert

Read here: keys and values, lists (also lists of keys), quoted text, [a, b] and {a: 1}, | and > text blocks, and comments. Anchors (&, *), tags (!!), and several documents in one text are not.

Your result

Paste YAML or JSON and the converted text appears here.

How to use it

  1. Choose YAML → JSON or JSON → YAML.
  2. Paste the text or press Try a sample.
  3. Copy the result or download it as a file.

Examples

  • A listskills: - math - code {"skills": ["math", "code"]}
  • A list of objects- name: Ada staff: 4 [{"name": "Ada", "staff": 4}]
  • Text that looks like a number{"zip": "11511"} zip: "11511"
Tool details and privacy

Paste YAML to get tidy JSON, or paste JSON to get clean YAML. Swap puts the result back in the box and converts it the other way.

Config files are often YAML while programs read JSON. Converting here needs nothing installed.

Options

  • Numbers, true, false, and null are read as their types; quoted text stays text.
  • When writing YAML, text is quoted only where it would otherwise be read wrongly, such as "yes" or "11511".
  • Multi-line text is written as a | block.

Limits

  • Anchors (& and *), tags (!!), and several documents in one text are not read; a message gives the line.
  • Indent with spaces; a line starting with a tab is refused.

Privacy

What you type stays in your browser. Nothing is uploaded or saved on the server.

Questions

Are comments kept?

They are read and skipped, because JSON has no comments.

Why is "11511" quoted?

It is text in the JSON; without quotes YAML would read it as a number.

What happens with &anchor?

A message says anchors are not supported and gives the line.

Is the text uploaded?

No.

Related tools

All tools