Convert JSON to YAML for Kubernetes

Kubernetes and CI tools want YAML, but lots of config starts as JSON. Convert it with correct indentation and types so the manifest applies cleanly.

Open this example in JSON ↔ YAML

Open the tool, then paste the sample input below. Everything runs locally in your browser.

Open this example in JSON ↔ YAML →

The problem

You have a snippet of JSON config but the target is a Kubernetes manifest or a CI file that expects YAML. Hand-converting risks wrong indentation or turning numbers into strings. A converter gives you valid YAML with the types preserved.

Sample input

JSON
{ "apiVersion": "v1", "kind": "ConfigMap", "data": { "LOG_LEVEL": "info", "RETRIES": 3 } }

Expected output

YAML
apiVersion: v1
kind: ConfigMap
data:
  LOG_LEVEL: info
  RETRIES: 3

Indentation is two spaces, the string stays a string, and 3 stays a number — exactly what kubectl apply expects.

How to do it

  1. Paste the JSON config.
  2. Convert it to YAML.
  3. Check indentation and value types.
  4. Copy the YAML.
  5. Paste it into your manifest or CI file.

Common mistakes

  • Wrapping the whole manifest in extra quotes so numbers become strings.
  • Tabs instead of spaces — YAML requires spaces for indentation.
  • Losing the document separator when combining multiple resources.
  • Boolean-like strings such as "yes" or "no" being read as booleans.
  • Forgetting that key order in YAML is cosmetic, not semantic.

Related tools

Related guides

FAQ

How do I convert JSON config to YAML?

Paste the JSON and convert it. The tool emits YAML with two-space indentation and preserves numbers, booleans, and strings as their original types.

Will my numbers stay numbers?

Yes. A JSON number converts to a YAML number, not a quoted string, so kubectl and CI tools read the value correctly.

Can I convert a whole Kubernetes manifest?

Yes. Paste the JSON form of the resource; the output is a valid YAML manifest you can apply. For multiple resources, separate them with a --- document marker.

Why did a value like "yes" become true?

YAML treats some bare words as booleans. Quote values such as "yes" or "no" if you mean the literal string.

Is my config uploaded?

No. Conversion runs locally in your browser. Nothing is sent to a server.

JSON to YAML conversion runs locally in your browser. Nothing is uploaded.

Explore more JSON and API contract tools

Convert, format, diff, query and validate JSON and API payloads — grouped in one place.

View the JSON & API contract toolkit →

Practical example and expected result

Kubernetes and CI tools want YAML, but lots of config starts as JSON. Convert it with correct indentation and types so the manifest applies cleanly. In practice, this is most useful when you need a quick, repeatable check on a JSON payload before adding it to a ticket, pull request, test fixture, or support note.

A realistic input for this workflow is { "apiVersion": "v1", "kind": "ConfigMap", "data": { "LOG_LEVEL": "info", "RETRIES": 3 } }. The expected result should resemble apiVersion: v1 kind: ConfigMap data: LOG_LEVEL: info RETRIES: 3, with the same important values preserved.

Troubleshooting checklist

  • Confirm you copied the complete JSON payload and not only a partial line or truncated preview.
  • Run the local tool once with a safe sample, then repeat with the real data only if your team policy allows it.
  • Check quoting, escaping, whitespace, encoding, timestamps, and environment-specific values before trusting the result.
  • Before sharing output, remove secrets, tokens, cookies, customer data, and production hostnames that are not needed for the review.

Next useful steps