N
NJHTools

JSON ↔ YAML Converter

Convert between JSON and YAML in both directions, with line-accurate error messages — perfect for Kubernetes and Docker Compose configs, right in your browser.

Each direction keeps its own input
JSON input0 characters
YAML output

How to use the JSON ↔ YAML converter

  1. Pick a direction with the tabs: JSON → YAML or YAML → JSON.
  2. Paste or type your source into the left input box — for example a Kubernetes manifest or a docker-compose.yml file.
  3. The converted output appears instantly on the right. If your input has a syntax error, an inline message shows what went wrong, with line information.
  4. When converting YAML → JSON, choose 2- or 4-space indentation for the formatted JSON.
  5. Click Copy to copy the result, or Try a sample to load an example.

Everything runs locally in your browser — your JSON and YAML are never sent to a server.

Frequently Asked Questions

What is the difference between JSON and YAML?↓

JSON and YAML are both data-serialization formats that represent the same kinds of structures (objects, arrays, strings, numbers, booleans, and null). JSON uses braces, brackets, and quotes and is common in APIs, while YAML uses indentation and is more human-readable, which is why it is popular for configuration files like Kubernetes manifests and Docker Compose. YAML is a superset of JSON, so any valid JSON is also valid YAML.

Is this converter free and does it run in my browser?↓

Yes. The JSON ↔ YAML converter is completely free with no signup required, and it processes everything 100% locally in your browser. Your JSON and YAML are never uploaded to or stored on any server.

Can I convert Kubernetes or Docker Compose YAML?↓

Yes. The converter handles standard YAML 1.1, which covers Kubernetes manifests and docker-compose.yml files. Paste your YAML to get equivalent JSON, or paste JSON to generate clean, indented YAML you can drop straight into your config.

What happens if my JSON or YAML has an error?↓

If your input cannot be parsed, the tool shows an inline error message instead of output. For invalid JSON it reports the problem with a line and column where possible, and for invalid YAML it surfaces the parser's message including the line number, so you can quickly locate and fix the mistake.

Can I control the indentation of the output?↓

Yes. When converting YAML → JSON you can choose 2-space or 4-space indentation for the formatted JSON output. YAML output is generated with standard 2-space indentation for clean, readable configuration files.

Last updated: