YamlForge

YAML ⇄ JSON ⇄ TOML ⇄ .ENV • 100% BROWSER-NATIVE

Convert & validate configs without uploading a single secret.

Bidirectional YAML, JSON, TOML, and .env workbench with line-level syntax diagnostics, anchor expansion, and Norway-problem linting—all running locally in memory.

Presets:
Source Input (Drag & Drop Supported)0 B
Converted Output
Valid Syntax
0 lines0 keysdepth 00.1 ms

Zero-Upload Privacy

Your Kubernetes manifests, API keys, and .env secrets never leave your browser tab. Works completely offline after initial load.

Norway-Problem & Tab Linter

Catches leading tabs, unclosed quotes, and ambiguous unquoted scalars like NO, on, and yes with exact line numbers.

Sub-Millisecond Engine

Pure TypeScript parser supports YAML anchors, multi-document --- streams, TOML tables, and flat .env exports in under 2ms.

TECHNICAL SPECIFICATION

The Engineering Guide to YAML, JSON, TOML & .env Conversion

Modern infrastructure spans four overlapping configuration languages. Understanding how data types, indentation rules, and scalar coercion behave across YAML, JSON, TOML, and environment files prevents production outages before they ship.

1. Why Zero-Upload Conversion Matters for DevOps & Cloud Teams

Every time an engineer pastes a Kubernetes Deployment manifest, a docker-compose.yml stack, a GitHub Actions workflow, or a .env configuration into a legacy web converter, that payload is often transmitted over HTTP POST to a remote backend for parsing. Even well-meaning server-side formatters routinely log request bodies in edge caches, APM traces, or reverse-proxy access logs. Because infrastructure configs frequently embed database connection strings, internal service hostnames, feature flags, and API tokens, sending raw configuration files across the network creates unnecessary exposure and compliance friction.

YamlForge executes its entire tokenization, abstract syntax tree construction, diagnostic linting, and serialization pipeline inside your browser tab using pure client-side TypeScript. Files opened via drag-and-drop are read locally through the HTML5 FileReader API—nothing is ever transmitted over the network, and the workbench continues operating seamlessly even when your workstation is disconnected from the internet or behind an air-gapped corporate VPN.

2. The YAML 1.1 "Norway Problem" & Implicit Type Coercion Pitfalls

One of the most infamous bugs in YAML history is known as the Norway Problem. Under the older YAML 1.1 specification still used by many legacy parsers and CI runners, unquoted scalars like NO, yes, no, on, off, y, and n are silently coerced into boolean values (false or true) instead of strings. For example, a list of European country codes containing GB, FR, and NO evaluates in memory as ["GB", "FR", false], breaking downstream JSON schema validators and API payloads. Similarly, GitHub Actions workflows rely on a top-level on: key, which YAML 1.1 parsers interpret as the boolean key true unless explicitly quoted.

YamlForge follows YAML 1.2 strict typing rules—where only true and false represent booleans—while actively scanning your input for YAML 1.1 ambiguous scalars. Whenever an unquoted yes, no, on, or off appears in a key or value, the diagnostics bar flags the exact line number. Leaving Quote Ambiguous enabled automatically wraps those scalars in double quotes when serializing back to YAML, guaranteeing safe round-trip portability across Helm charts, Ansible playbooks, Docker Compose files, and Python PyYAML services.

3. Format Comparison: YAML vs. JSON vs. TOML vs. .env

Choosing the right format depends on whether a file is authored primarily by humans, parsed by strict REST APIs, or injected as flat process environment variables at container startup. The matrix below summarizes structural trade-offs across all four formats supported by YamlForge:

DimensionYAML 1.2JSONTOML.env
Primary EcosystemKubernetes, Docker, CI/CD, AnsibleREST APIs, Node.js, SchemasRust Cargo, Python pyproject, HugoRuntime secrets & 12-Factor apps
Comments AllowedYes (#)No (strict RFC 8259)Yes (#)Yes (#)
Nesting Model2/4-space indentationBraces {} & brackets [][section] table headersFlat UPPER_SNAKE_CASE
Multi-line StringsLiteral | & folded >Escaped \n sequencesTriple-quoted """..."""Quoted strings
Tab SensitivityTabs forbidden in indentWhitespace agnosticWhitespace agnosticLine-delimited

4. Practical Workflow: Multi-Document Kubernetes Streams, Anchors & Block Scalars

Real-world DevOps manifests rarely consist of simple flat key-value pairs. Kubernetes bundles frequently combine multiple resources inside a single file separated by --- document markers, while Docker Compose and CI pipelines lean heavily on YAML anchors (&defaults), aliases (*defaults), and merge keys (<<: *defaults) to reuse shared environment variables or resource limits without duplicating blocks. JSON and TOML have no native syntax for anchors or multi-document streams. When converting anchored YAML to JSON, YamlForge resolves anchors and merges inherited properties into concrete objects so your resulting JSON payload matches the exact runtime configuration evaluated by your cluster.

Multi-line scripts and inline certificates present another common conversion headache. YAML uses literal block scalars (|) to preserve line breaks verbatim—essential for shell commands inside GitHub Actions run: steps or embedded TLS certificates—and folded block scalars (>) to unwrap prose paragraphs into single lines. When converting YAML to JSON, YamlForge encodes those blocks into valid escaped strings, and when converting back from JSON to YAML, any string containing newline characters is automatically emitted as a clean | or |- literal block instead of an unreadable single-line escaped literal.

5. Deterministic Diffs, Indentation Standards & .env Flattening

Configuration drift often starts with inconsistent formatting across teammates' editors. One developer saves JSON with 4-space indentation while another commits 2-space YAML with keys in arbitrary order, creating noisy Git pull requests that obscure real behavioral changes. Using YamlForge's Sort Keys toggle recursively orders object keys alphabetically at every nesting level, producing canonical, diff-friendly output in YAML, JSON, TOML, or .env.

Finally, when migrating settings from structured Helm values or JSON app configs into containerized runtime environments, YamlForge flattens nested paths directly into 12-Factor .env variables in one click. Deep objects like database.pool.max become DATABASE_POOL_MAX, arrays serialize as comma-separated values, and strings containing whitespace or hash characters are safely quoted—eliminating manual copy-paste errors during local testing and deployment.

FREQUENTLY ASKED QUESTIONS

Common Questions

Are my YAML, JSON, or .env secrets uploaded to a server?

No. YamlForge runs 100% locally in your browser using native JavaScript. Your Kubernetes manifests, API keys, and .env files never leave your device and no telemetry or payloads are ever transmitted.

How does YamlForge handle the YAML "Norway Problem" (NO, yes, on, off)?

YamlForge follows YAML 1.2 typing so unquoted NO, yes, on, and off stay strings instead of turning into booleans, while displaying a warning badge and offering a Quote Ambiguous toggle for YAML 1.1 compatibility.

Does the YAML parser support anchors, aliases, and merge keys?

Yes. Standard YAML anchors (&name), aliases (*name), and merge keys (<<: *name) are expanded cleanly during conversion to JSON, TOML, or .env.

Can I convert multi-document Kubernetes YAML separated by ---?

Yes. Multi-document YAML streams separated by --- markers are parsed into an array of documents when exporting to JSON and preserved with --- separators when formatting back to YAML.

Why does YAML reject tabs for indentation?

The YAML specification forbids tab characters for structural indentation because different editors render tab widths inconsistently. YamlForge detects leading tabs and reports the exact line and column number.

How are nested YAML or JSON objects converted to .env format?

Nested keys are flattened using underscores and converted to uppercase SNAKE_CASE (for example, database.host becomes DATABASE_HOST), with values containing spaces or # automatically quoted.

Does YamlForge work offline after the page loads?

Yes. Once loaded, all conversion, validation, file drag-and-drop (FileReader), and download features work completely offline with zero network calls.