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
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.
Keys
25
Object keys at every level.
Nesting depth
6
Levels of objects and lists.
YAML documents
1
Separated by ---.
Size (bytes)
516
UTF-8 size of the result.
Checks
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
Version v1.0Updated Update history
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.
Three steps
Nothing to install and nothing uploaded.
-
1
Choose the direction
JSON → YAML for config files and readable docs; YAML → JSON for APIs, scripts and anything that expects JSON.
-
2
Paste the input
The result appears as you type. Errors point to the line and column; checks flag values worth quoting.
-
3
Copy, download or swap
Copy the result, download it as
data.yamlordata.json, or swap the direction to check the round trip.
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
nullare quoted; multi-line strings use a|block - Writing JSON: one document becomes one value, several become an array;
.infand.nancannot be converted
| JSON | YAML output | Why |
|---|---|---|
"pro" | pro | Plain 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 |
null | null | Same keyword in both |
"" | '' | An empty plain value would be null |
"line 1\nline 2" | |- block | Keeps the line break readable |
The YAML sample, converted
The YAML example uses three features JSON does not have. This is what happens to each of them.
| In the YAML | In the JSON | Note |
|---|---|---|
# tracking-plan.yaml comment | Gone | JSON has no comments; the tool says how many were dropped |
defaults: &money and amount: *money | amount gets a full copy of the object | Anchors 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.
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.
A tracking plan that the data actually follows
Teams often keep their tracking plan as YAML or JSON in a repository. In TapCub the events and properties you send are checked on arrival, so the plan and the data do not drift apart unnoticed.
Custom events and properties
Track orders, sign-ups or any business action with the fields you care about, then chart and filter by them.
Learn moreData-quality checks
Unexpected event names, missing properties and wrong types are flagged; duplicates can be merged or renamed.
Learn moreSDKs and server API
Seven platform SDKs plus a server API, all sending into one project with shared event names.
Learn moreJSON 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.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· 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
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.