YAML to JSON

Convert YAML config into formatted JSON. Free, in your browser.

Converts YAML to formatted JSON in your browser.

Free to use — premium coming soon

FREE
  • Formatted JSON
  • Error messages
  • 100% private
PREMIUM
  • Remove ads
  • Schema validation

About the YAML to JSON

YAML to JSON converts a YAML document into equivalent JSON. YAML is the format people write by hand for configuration files, GitHub Actions workflows, Kubernetes manifests, Docker Compose, and CI pipelines, because it is readable and lets you add comments. JSON is the format machines exchange over the wire: almost every REST API, JavaScript runtime, and validation library speaks it natively. This tool bridges the two. Paste your YAML, and it parses the indentation-based structure into nested objects and arrays, then serializes that structure as standard JSON you can drop into an API request, a config loader, or a test fixture.

Reach for this converter whenever something downstream expects JSON but your source of truth is YAML. Common cases: posting a Kubernetes manifest to an API that only accepts JSON bodies, feeding a YAML config into JavaScript code where JSON.parse is built in but a YAML parser is an extra dependency, generating JSON fixtures from human-friendly YAML, or simply diffing two formats. It is also a debugging trick. Because YAML infers types from unquoted text, converting to JSON shows you exactly what the parser saw, so you can spot a value that became a number, a boolean, or null when you meant a string.

Under the hood the tool reads YAML's structure from indentation and key markers, builds an in-memory tree of mappings, sequences, and scalars, then writes that tree back out using JSON syntax with braces, brackets, and double-quoted keys. Scalars are resolved to JSON types: unquoted 42 becomes a number, true becomes a boolean, an empty value or null becomes JSON null, and quoted text stays a string. Note that JSON has no equivalent for YAML comments or anchors, so those are dropped or expanded during conversion. Indentation must use spaces, never tabs, or parsing will fail.

Conversion runs entirely in your browser. Your YAML is never uploaded to a server, which matters because config files often hold API keys, connection strings, or internal hostnames. One accuracy caveat worth knowing: YAML's automatic typing can surprise you. In older YAML 1.1 parsers the strings yes, on, and the country code NO are read as booleans, and a value like 1.10 collapses to 1.1. The resulting JSON faithfully reflects whatever the parser decided, so if a field looks wrong, quote it in your YAML and convert again.

Frequently asked questions

Is every JSON document also valid YAML?

Yes, as of YAML 1.2 (released 2009) the spec is designed to be a strict superset of JSON, so any valid JSON is also valid YAML. The reverse is not true: YAML has features like comments, anchors, and multi-document files that have no JSON equivalent and are lost or rejected when converting to JSON.

Why does my conversion fail or change values unexpectedly?

The most common cause is indentation: YAML forbids tabs, so a stray tab character produces a parse error even though the file looks fine. Unexpected values usually come from YAML's automatic typing, where unquoted text like yes, no, or 08080 is read as a boolean or number. Wrap such values in quotes to keep them as strings.

What happens to comments and anchors when I convert to JSON?

JSON does not support comments, so any # comments in your YAML are discarded. YAML anchors and aliases (& and *) are expanded into their referenced values, so the JSON output contains the full duplicated data rather than a reference.

What is the Norway problem in YAML?

It is a famous typing pitfall where the string NO (Norway's country code) is parsed as the boolean false in YAML 1.1 parsers, so a list like [FI, NO, SE] becomes ["FI", false, "SE"]. YAML 1.2 removed most of these implicit boolean aliases, but many tools still run 1.1 parsers, so quoting string values is the safe habit.

Does my data get uploaded anywhere?

No. The conversion happens locally in your browser using JavaScript, so your YAML is never sent to a server. That keeps secrets such as API keys or database passwords that often live in config files private to your machine.

From our blog

Reading Epoch Time Like a Pro: A Practical Guide to Unix Timestamps

By the Super Simple Digital Tools Team · Updated June 2026

If you have ever opened a log file or an API response and found a field like 1700000000 where you expected a date, you have met Unix time. Rather than storing a fragile text string such as "Nov 14 2023 22:13 EST", computers prefer a single integer counting seconds from a fixed origin: midnight UTC on 1 January 1970. That origin is the epoch, and the count is the timestamp. One number, no formatting, no language or locale baked in, and trivial to compare or subtract. It is this simplicity that made epoch time the lingua franca of databases, network protocols, and operating systems.

Decoding one by hand is harder than it looks because the number hides three pieces of information at once: the unit, the sign, and the implied UTC reference. The single most common mistake is the unit. A value in seconds and the same instant in milliseconds differ by a factor of a thousand, so a 13-digit number fed into a tool expecting seconds will land you tens of thousands of years in the future. The fix is to glance at the digit count first: roughly ten digits means seconds for any present-day date, thirteen means milliseconds. When in doubt, paste it here and read both interpretations at once.

The second trap is time zones, and the cure is to remember that the raw number does not have one. A timestamp is a fixed point on a universal axis; only when you format it for display does a zone get involved. Two servers in different countries logging the same event will record the identical epoch value, even though their local clocks read different wall-clock times. That is exactly why epoch time is so useful for distributed systems, and why you should always confirm whether a displayed date is in UTC or in your own local zone before drawing conclusions during debugging.

The third thing worth understanding is what the number quietly omits. Unix time pretends every day has exactly 86,400 seconds and skips leap seconds entirely, the occasional one-second corrections that keep civil time aligned with the Earth's slightly irregular rotation. Twenty-seven of those have been added since 1970, so Unix time differs from true elapsed atomic time by that small amount. For almost all everyday work this is invisible, but it matters for high-precision scientific timing and explains why epoch time is not a perfect stopwatch of physical seconds.

Finally, keep the 2038 cliff on your radar. Software that still squeezes a timestamp into a signed 32-bit integer will run out of room at 03:14:07 UTC on 19 January 2038, after which the counter overflows and flips to a date in 1901. Sixty-four-bit storage pushes that limit hundreds of billions of years away, so the practical advice is to make sure long-lived systems, embedded devices, and database columns use 64-bit time. Understanding these four ideas, units, sign, time zone, and storage width, turns epoch time from a cryptic blob into a tool you can trust.

  • Check the digit count before converting: about 10 digits is seconds, 13 is milliseconds. Multiply or divide by 1000 to switch between them.
  • Always note whether the output you are reading is UTC or local time; the underlying timestamp itself carries no time zone.
  • When comparing two events, subtract their epoch values directly: the difference is the exact number of seconds (or milliseconds) between them, with no calendar math needed.
  • For any system expected to run past 2038, confirm timestamps are stored in 64-bit integers to avoid the 32-bit overflow that wraps dates back to 1901.

Read the full guide →

Tool by the Super Simple Digital Tools Team. Reviewed by our editorial team. Free to use, no signup required.

Related tools