Skip to content

YAML to JSON

Convert a bounded YAML data subset into formatted JSON entirely in your browser.

YAML → JSON90 characters
Paste configuration text. The live preview stays inert and is limited for responsiveness.
JSON previewReady
{
  "project": "toolbox",
  "enabled": true,
  "ports": [
    3000,
    3001
  ],
  "service": {
    "name": "api",
    "retries": 2
  }
}
Processed on your device

How it works & useful details

Supported YAML

Convert the safe YAML data subset: two-space nested maps and lists, comments, quoted/plain strings, booleans, null and finite safe numbers. Anchors, aliases, tags, directives, flow collections and block scalars are rejected rather than guessed.

JSON preserves map order from the input. Large integer identifiers should be quoted because JSON numbers use JavaScript precision.

Private, bounded processing

This workspace parses text only in your browser. It never opens links, requests external entities, runs pasted configuration, or saves your document. Input is limited to 500,000 characters; conversion output is limited to 1,000,000 characters.

About this tool

YAML to JSON converts a bounded YAML data subset into formatted JSON. It covers the structures commonly found in CI configuration, Kubernetes manifests, and application settings without supporting YAML features that produce surprising behavior.

The converter runs locally and reports constructs outside its subset, such as anchors, aliases, and custom tags, instead of approximating them. Values keep their meaning rather than being silently coerced.

How to use it

  1. Paste the YAML document.
  2. Convert to produce JSON with nested objects and arrays.
  3. Review warnings for unsupported YAML features.
  4. Copy or download the JSON output.

Worked example

project: toolbox
enabled: true
version: 1.10
country: NO
ports:
  - 3000
  - 3001
service:
  name: api
  retries: 2

converts to

{
  "project": "toolbox",
  "enabled": true,
  "version": 1.1,
  "country": "NO",
  "ports": [3000, 3001],
  "service": { "name": "api", "retries": 2 }
}

Note "version": 1.1. An unquoted 1.10 is a number in YAML, and its trailing zero is lost. Quote version strings (version: "1.10") in your YAML. NO stays a string here, following YAML 1.2, but a YAML 1.1 parser would read it as false, so quote it in shared files too.

Supported YAML

The converter handles the data subset that most configuration files use: nested maps and lists with two-space indentation, comments, quoted and plain strings, booleans, null, and numbers. That covers typical Docker Compose, GitHub Actions, and application config files.

Anchors and aliases (&base, *base, <<:), tags (!!str), flow collections ({a: 1}), and multi-line block scalars (| and >) are reported instead of guessed. Inspect them with a full YAML implementation. Large integers such as account IDs should be quoted, because JSON numbers in JavaScript lose precision above 2⁵³.

Frequently asked questions

Are anchors and aliases supported?

They are not expanded; the tool reports them so you can resolve the structure before converting.

How are multiline strings handled?

Standard block and folded scalar styles in the supported subset are converted to plain JSON strings with their line breaks preserved.

What is the limit?

Up to 500,000 characters of YAML input.

Why does indentation with four spaces fail?

This converter expects exactly two spaces per nesting level, the most common YAML style. Re-indent the file, or check the reported line in the YAML validator.