TapCub is live — analytics, insights and live chat, free on one platform

Free tool JSON to YAML converter, and back

Paste JSON to get clean YAML for a config file, or paste YAML to get JSON for an API or a script. Values keep their type on the way through: a string that only looks like a boolean, a date or a number is quoted so the next parser reads it the same way.

  • Both directions
  • Errors by line
  • Runs locally
Converter

Convert JSON and YAML

The sample is a small tracking plan: the events a product sends and the properties each one carries. Swap the direction to turn the result back.

Strict JSON, or YAML 1.2. Several YAML documents separated by --- become a JSON array.

Converted to YAML.

Keys

25

Object keys at every level.

Nesting depth

6

Levels of objects and lists.

Size (bytes)

516

UTF-8 size of the result.

YAML
version: 2
owner: growth@example.com
review: '2026-12-01'
events:
  - name: signup
    description: Account created
    properties:
      plan:
        type: string
        enum:
          - free
          - pro
      country:
        type: string
        example: 'NO'
  - name: order_paid
    description: Payment confirmed
    properties:
      amount:
        type: number
        required: true
      currency:
        type: string
        example: USD
      coupon:
        type: string
        nullable: true
Runs entirely in your browser. Nothing you type here is uploaded or stored by TapCub.

Version v1.0Updated Update history

Read the result

What the converter tells you

Besides the converted text you get a verdict, a few counts and a list of checks.

Converted, or line and column

JSON is parsed strictly, YAML as YAML 1.2. On an error the position is where the parser stopped; the mistake is there or just before it. If you paste YAML while JSON → YAML is selected, the tool notices and suggests swapping.

Keys and depth

The same data in either format has the same counts, which makes them a quick check that nothing was lost. Depth counts nested objects and lists; deeply nested config is harder to edit by hand in either format.

Quoted values in the YAML

Quotes appear only where they are needed for the value to read back as the same type: 'NO', '2026-12-01', 'on', '0755'. Everything else is written plain.

Checks

For YAML input: values that YAML 1.1 tools read differently, comments that JSON cannot keep, anchors that were expanded, and numbers too large for JavaScript.

Conversion goes through data, not text: JSON key order is kept, but YAML comments, anchor names and the choice between block and flow style are not. Dates stay as strings rather than becoming timestamps.

How to use it

Three steps

Nothing to install and nothing uploaded.

  1. 1

    Choose the direction

    JSON → YAML for config files and readable docs; YAML → JSON for APIs, scripts and anything that expects JSON.

  2. 2

    Paste the input

    The result appears as you type. Errors point to the line and column; checks flag values worth quoting.

  3. 3

    Copy, download or swap

    Copy the result, download it as data.yaml or data.json, or swap the direction to check the round trip.

Mapping rules

How JSON and YAML values correspond

YAML 1.2 was designed so that JSON is (almost) a subset of it. The converter uses the YAML 1.2 core schema for reading and quotes on output anything a YAML 1.1 reader could take as another type.

  • Reading YAML: js-yaml 4.3.2 with the core schema plus << merge keys; duplicate keys and tab indentation are errors
  • Writing YAML: strings that look like booleans, numbers, dates or null are quoted; multi-line strings use a | block
  • Writing JSON: one document becomes one value, several become an array; .inf and .nan cannot be converted
JSON values and their YAML form
JSONYAML outputWhy
"pro"proPlain text needs no quotes
"NO"'NO'Unquoted it is false in YAML 1.1
"2026-12-01"'2026-12-01'Unquoted many parsers turn it into a date
"0755"'0755'Unquoted it is a number
nullnullSame keyword in both
""''An empty plain value would be null
"line 1\nline 2"|- blockKeeps the line break readable
Worked example

The YAML sample, converted

The YAML example uses three features JSON does not have. This is what happens to each of them.

YAML-only features in the sample and their JSON result
In the YAMLIn the JSONNote
# tracking-plan.yaml commentGoneJSON has no comments; the tool says how many were dropped
defaults: &money and amount: *moneyamount gets a full copy of the objectAnchors and aliases are resolved
tax: with <<: *money and required: false{"type": "number", "required": false}Merge keys copy the anchor, then local keys override
review: 2026-12-01"review": "2026-12-01"Kept as a string, not converted to a timestamp

Converting the JSON back gives YAML without the anchor: the data is the same, the shorthand is not. If you maintain the YAML by hand, keep the YAML as the source.

Common mistakes

Where conversions go wrong

Most surprises come from types, not syntax.

Hand-writing YAML without quotes

In a file you edit later, country: NO, version: 3.10 or zip: 02108 may not be what a program reads. Converting through this tool quotes them; hand edits do not.

Large IDs as numbers

Integers above 9,007,199,254,740,991 lose precision in JavaScript, and so in this tool. Keep 64-bit IDs as strings in both formats.

Expecting comments to survive

JSON has nowhere to put them. Keep documentation in a description field if it must travel with the data, as the sample does.

Pasting secrets into web tools

Configs often hold API keys and passwords. This tool runs locally and keeps the input out of the share link, but remove secrets before pasting a config into any online tool.

FAQ

JSON to YAML questions

Still have a question?

Chat with the team behind TapCub — we usually reply within a few hours on business days.

How do I convert JSON to YAML?

Paste the JSON with JSON → YAML selected. Objects become indented keys, arrays become lists with -, and strings are quoted only when they would otherwise read as another type. Choose 2 or 4 spaces; YAML does not allow tabs.

How do I convert YAML to JSON?

Choose YAML → JSON and paste the YAML. Anchors, aliases and merge keys are resolved, comments are dropped, and several documents separated by --- become a JSON array. Errors are reported with the line and column.

Is YAML a superset of JSON?

Almost. YAML 1.2 was aligned so that practically every JSON document is valid YAML, which is why you can paste JSON into most YAML files. The reverse is not true: comments, anchors, multi-line blocks and unquoted strings have no JSON form.

Why are some values quoted in the YAML output?

Because unquoted they would read back as a different type: NO and on as booleans in YAML 1.1, 2026-12-01 as a date, 0755 as a number. The quotes keep the round trip exact for any parser.

Why did my dates stay strings?

JSON has no date type, so the converter keeps 2026-12-01 as text instead of turning it into a timestamp with a time zone. That way converting back gives exactly what you started with.

Why are the key counts the same in both directions?

The counts describe the data, not the text. If the YAML → JSON count is higher than you expect, an anchor was probably expanded into several copies.

Is my data uploaded?

No. Conversion runs in your browser with a YAML library downloaded once from tapcub.com. The input is never written into the share link, which only carries the direction and layout options.

Changelog

Update history

New features, fixes and data refreshes for this tool, newest first.

  1. · v1.0

    LaunchedFirst release.

Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates

Next step

Send events that match your plan

Connect your site or app and the events and properties you send show up as filters, breakdowns and funnel steps, with type checks on arrival.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics