json

FormatValidateConvert

JSON to YAML converter

Source

JSON

Result· read-only

—YAML

The result appears here.

Start over?

This clears the source, the result and the Path.

Convert

Convert JSON to and from YAML, XML, CSV and more.

Your document never leaves the browser.

Convert JSON to and from YAML, XML and CSV — in your browser, never uploaded.

Pick a pair, paste or drop a document, and the result is written as you type. Any format the page can read converts to any other it can write, by way of JSON, the format the rest of the site edits, compares and queries.

30

pairs, any From with any other To

→ JSON →

the step shown when neither side is JSON

0

bytes leave your machine

Every pair, one page

From reads JSON, YAML, XML, CSV and TSV. To writes all five, a GitHub-flavoured Markdown table, and SQL for PostgreSQL, MySQL or SQLite, and any From goes with any other To. Types and classes in ten languages are made on Generate, the workspace beside this one.

When neither side is JSON, as in YAML to XML or CSV to SQL, the page reads the source to JSON first and writes the result from that JSON. The row shows the step as → JSON →, and the result card gains a JSON tab beside the result, so the intermediate document can be read, copied, downloaded or opened in the editor. When the writing half refuses (a table from a document with no rows, say), the message points at the JSON step rather than at your source.

Paste a whole document, open a file or drop one on the source, and the page works out what it is: CSV pasted while the pair is JSON to SQL makes it CSV to SQL, and the page says so. To only moves when it would equal From. The options for the pair sit between the two panes and apply as you change them, under headings such as Read CSV and Write SQL when a pair needs both.

Press ⇄ to turn a pair around whenever its result can be read back: YAML to XML becomes XML to YAML, with the XML as the new source. A Markdown table or SQL is never read back, so those pairs stay one way.

1

YAML, with the pair set to YAML to XML

order:
  id: 7
  item:
    - pen
    - ink
2

The JSON tab, the step between the two

{
  "order": {
    "id": 7,
    "item": [
      "pen",
      "ink"
    ]
  }
}
3

The XML, written from that JSON

<?xml version="1.0" encoding="UTF-8"?>
<order>
  <id>7</id>
  <item>pen</item>
  <item>ink</item>
</order>

The same engines as the editor

Nothing here is a second implementation. A YAML file converted on this page and the same file opened in the editor give the same JSON, byte for byte, with the same notices. Numbers are copied as written, so a 20-digit identifier keeps every digit in both directions, and a conversion that cannot be done says where — the line and the column — instead of guessing.

When a conversion loses something, the result says what: comments not carried into JSON, anchors expanded, sibling order changed. Those sentences are the engine’s own.

1

YAML holding a 20-digit number

id: 12345678901234567890
name: Ada
2

The JSON from YAML to JSON, every digit kept

{
  "id": 12345678901234567890,
  "name": "Ada"
}

Between Convert and the editor

Convert in the header carries the document you were editing across, and Open JSON in Editor carries the JSON side of a conversion back, or the JSON step when neither side is JSON. The editor asks before it replaces a document, and one undo puts the old one back.

Private by construction

The conversion runs in your browser, in the same engine the editor uses. The document is never uploaded, never logged and never leaves your machine — there is no server to send it to. Once the page has loaded it keeps working with the connection off.

FAQ

Frequently asked questions

Didn’t find your answer?Write to us on the contact page →
How do I convert a JSON file to another format?

Choose From and To, then paste, open or drop your JSON document. The result is written in the format you chose, and rewritten as you type.

How can I convert a file to JSON?

Set To to JSON and From to YAML, XML, CSV or TSV. Alternatively, paste the whole document and let the page recognise the source format.

Can I convert JSON to Excel, PDF or Word?

No. This converter writes no PDF, Word or .xlsx file. For Excel, choose JSON to CSV and download the CSV, a file that Excel opens.

What formats can JSON be converted to?

JSON can become YAML, XML, CSV, TSV, a GitHub-flavoured Markdown table, or SQL for PostgreSQL, MySQL and SQLite. Generate makes types in eleven languages.

Which conversions have a page of their own?

YAML to JSON, JSON to YAML, XML to JSON, JSON to XML, CSV to JSON, JSON to CSV, JSON to TSV, JSON to a Markdown table and JSON to SQL. Every other pair works here too — choose it with From and To.

Can I convert CSV to XML, or XML to CSV?

Yes. Choose either pair with From and To; conversion passes through JSON. The row displays → JSON → and a JSON tab lets you inspect that intermediate document.

Is my file uploaded when I convert it?

No. Your source is converted locally by the browser, without an upload or a log of its contents. Conversion continues offline after the page loads.

Is there a size limit?

No fixed one. Large documents convert after a short "Converting…", and a document over 10 MB waits for you to press Convert, so a paste never freezes the page.

Does the page remember my document?

For this tab, yes: a reload brings the source back. A new tab starts empty, and nothing is kept once the tab is closed.

Keyboard shortcuts

Send feedback

Questions, bug reports and feature requests are all welcome. A bug report is easiest to act on with the shape of the document that caused it — never send anything confidential.

Email us

Contact page, in a new tab, so this page stays as it is.

Settings

Indent

The result is written with it — YAML and XML at 2 spaces when it is Tab.

Code text size
14 px

Both panes.

Wrap long lines

Load from a URL

Your browser fetches it directly — the request goes to that site, never to us.