Guides · Utiltown

YAML to JSON Converter: Avoid the Norway Problem

YAML is the default for human-edited configuration — Kubernetes manifests, Docker Compose, GitHub Actions, and Ansible all use it. JSON is the default for APIs, OpenAPI schemas, and machine-generated pipelines. Converting YAML to JSON bridges the two: you keep YAML for editing, then emit JSON for systems that consume it.

This guide explains what survives conversion and what does not, the coercion traps to watch for (especially the Norway problem), how multi-line strings are handled, and how to use Utiltown\'s YAML to JSON converter locally in your browser.

Core Concepts

How to Use This Site\'s Tool

  1. Open YAML to JSON.
  2. Paste your YAML into the input area, or upload a .yaml/.yml file.
  3. Review the JSON output: check for coerced booleans, numbers, and dates that should have been quoted strings.
  4. Fix the source YAML with explicit quotes if coercion changed a value.
  5. Copy or download the JSON result.

Bottom Line

Edit in YAML, ship in JSON. Convert at YAML to JSON, catch coercion surprises before they reach production, and keep everything local and private.

Frequently Asked Questions

Why convert YAML to JSON?

YAML is popular for human-edited config (Kubernetes, CI, Ansible), but JSON is the lingua franca of APIs, OpenAPI schemas, and machine pipelines. Converting YAML to JSON lets you consume hand-written config in systems that only accept JSON.

What is the Norway problem?

YAML 1.1 parsers treat unquoted tokens like NO, ON, OFF, YES as booleans, so country: NO becomes false. Always quote values that are semantically strings before converting to JSON, or coercion bugs will silently corrupt your data.

Are comments preserved?

No. JSON has no comment syntax, so YAML comments, anchors, and aliases are dropped during conversion. Only the data survives; formatting and commentary do not.

Is my data uploaded?

No. This site's YAML to JSON converter runs entirely in the browser. Your YAML is parsed locally and never sent to any server.

What about multi-line strings and block scalars?

YAML block scalars (<code>|</code> and <code>&gt;</code>) fold into single JSON strings. Newlines and indentation are normalized according to YAML rules, so the JSON string may look different from the source layout but represents the same text.