YAML Nesting {{ yamlTransformStage.depthLabel }} Seq {{ yamlTransformStage.sequenceLabel }} {{ yamlTransformStage.outputLabel }}
YAML converter input
Paste YAML, or drop one .yml, .yaml, or .txt file; multi-document streams with --- are supported.
{{ input_text.length.toLocaleString() }} chars Drop YAML, YML, or TXT onto the textarea.
Choose 2 or 4 spaces for review, or 0 for compact one-line JSON.
Enter 1-8 spaces; 2 is typical for config files.
Enter 0 for no wrapping, or 40-240 for wrapped scalar lines.
Turn on before comparing generated config files.
{{ yaml_sort_keys ? 'On' : 'Off' }}
Use for strict string-only loaders; leave off to preserve cleaner YAML.
{{ yaml_force_quotes ? 'On' : 'Off' }}
Applies only while Force YAML quotes is on.
Turn on for simple loaders that do not understand anchors.
{{ yaml_no_refs ? 'On' : 'Off' }}
Examples: app.name or app/name.
Enter 50-2000 rows; lower values keep long documents responsive.
Example: APP produces APP_DATABASE_HOST.
Leave on for conventional .env files; turn off for lowercase targets.
{{ uppercase_env ? 'On' : 'Off' }}
Field Value Copy
{{ row.label }} {{ row.value }}
No YAML document loaded
Paste, drop, or browse a YAML source to populate the document ledger.
{{ normalizedYaml }}
{{ iniText }}
{{ envText }}
{{ propertiesText }}
Document Path Type Preview Copy
Doc {{ row.docIndex }} {{ row.path || '(root)' }} {{ formatTypeLabel(row.type) }} {{ row.preview }}
No flattened paths yet
Parse YAML with scalar values to populate this path ledger.
Path Types Docs Example Copy
{{ row.path }} {{ row.types }} {{ row.docs }} {{ row.example }}
No schema details yet
Parse a YAML document to summarize paths, types, and examples.

        
Customize
Advanced
:

Introduction:

YAML often sits between human review and machine configuration. Teams use it for deployment manifests, application settings, infrastructure snippets, log examples, and data samples because indentation keeps nested values readable. Conversion becomes necessary when the same information must become JSON for an API, assignment text for a runtime, INI for an older loader, or a path list for audit and comparison.

The format is compact because a few visible marks carry a lot of meaning. A colon separates keys from values, a dash starts a sequence item, indentation decides parent and child relationships, and --- can separate several documents in one stream. Anchors and aliases can reuse earlier content, and block scalar styles decide whether line breaks are preserved or folded.

Mapping
A key-value structure, similar to a JSON object.
Sequence
An ordered list of values, often written as dash-prefixed lines.
Scalar
A single value such as text, a number, a boolean, a timestamp, binary data, or null.

Not every destination can keep every YAML idea. JSON can keep nested mappings, sequences, booleans, numbers, strings, and nulls, but comments and original spacing are presentation details rather than data values. Env, INI, and properties text work best with scalar leaves because they are line-based assignment formats. A whole nested branch usually needs JSON or normalized YAML, not a single flat assignment line.

YAML destination format differences
Destination Best fit Main caution
JSON Structured data exchange when nested values and types should remain machine-readable. Comments, original quote choices, and original spacing are not carried as values.
Normalized YAML Reviewing the parsed values with consistent indentation, wrapping, quoting, key order, and anchor handling. The file may look different even when the parsed values are the same.
Env, INI, properties Scalar configuration leaves that can be represented as name-value text. Generated names still need a destination-specific parser check.
Paths and schema Finding where values live, which documents contain them, and whether a path changes type. A tidy path ledger does not prove another platform accepts the generated key spelling.
YAML stream parsed into documents and scalar leaves before structured and assignment outputs
Conversion is safest after the parsed document shape and scalar leaves have been checked.

A valid YAML parse is only the first gate. The converted text still needs review for destination rules, reserved names, required sections, duplicate meaning, quoting expectations, and secrets that should not be copied into flat configuration files.

How to Use This Tool:

Start by loading the YAML source, then verify the parsed document shape before copying generated text.

  1. Paste source into YAML content, drop one .yml, .yaml, or text file onto the editor, or select Browse file. Multi-document streams separated by --- are supported.
  2. Stop when an error message appears. JSON input detected, YAML parse error, and YAML parser unavailable all mean the generated tabs are not ready to trust.
    A standalone JSON object or array is rejected here so YAML-specific review is not bypassed. Convert JSON to YAML first when the source is already JSON.
  3. Read Document Ledger before copying output. Confirm the document count, root type, top-level keys or items, total nested keys, scalar count, maximum depth, sample keys, and sample values.
  4. Open Advanced for formatting and serialization choices. Set JSON spacing, YAML indent, YAML line width, Sort YAML keys, Force YAML quotes, YAML quote mark, and Expand YAML anchors to match the receiving parser or review requirement.
  5. Choose Path separator and Path preview limit before relying on Paths or Schema. Dot notation is easier for object-style review; slash notation is useful when path segments must stay visibly separated.
  6. Set ENV prefix and Uppercase env keys before using Env. Review INI and Properties when arrays, punctuation-heavy keys, or multiple documents could change generated names.
  7. Finish in Schema and Paths. A path that appears in fewer documents than expected, shows more than one type, or has a surprising scalar preview should be corrected or explained before the generated text is reused.

Interpreting Results:

Read the parsed shape before the generated text. The most useful confidence checks are document count, root type, total scalar count, flattened path spelling, and type consistency across documents.

  • Document Ledger confirms whether the source became one document or several, and whether each document starts as an object, array, scalar, or empty value.
  • YAML and Generated JSON show structured output. They can preserve values and nesting, but not comments or the exact original layout.
  • Paths shows leaf addresses, document numbers, types, and previews. A trimmed visible preview affects the table on screen, while exports can still include the discovered path set.
  • Schema groups paths across documents. Mixed types on the same path deserve review before migration.
  • Env, INI, and Properties include scalar leaves. Nested objects and arrays remain visible through structure views rather than direct assignment lines.

The false-confidence risk is assuming a clean conversion means the destination will accept the result. Test copied text with the actual application, deployment platform, or parser, and double-check generated names when paths contain array indexes, document prefixes, quoted keys, or punctuation.

Technical Details:

YAML conversion is a parse-then-serialize transformation. YAML 1.2.2 describes a stream as one or more documents, and each document resolves to mappings, sequences, and scalars. Indentation, indicators, anchors, aliases, and scalar style affect the parsed value before any target format is written.

JSON keeps structured values with objects, arrays, strings, numbers, booleans, and null. Assignment-oriented formats are narrower because they communicate names and string values line by line. That narrower value model is why scalar leaves can be emitted directly, while objects and arrays are better inspected through structured output, paths, and schema summaries.

Transformation Core

Every generated view starts from the parsed document values, not from text replacement in the original YAML.

YAML transformation core
Step What carries forward What needs review
Parse the stream Document boundaries, root values, nested keys, list positions, scalar values, aliases, and empty values. Invalid indentation, unresolved syntax, or standalone JSON stops conversion.
Summarize documents Root type, top-level counts, nested key totals, scalar totals, maximum depth, and sample values. A valid root scalar or unexpected array can still be unsuitable for a configuration destination.
Serialize structure Normalized YAML and generated JSON keep the parsed tree visible for review. Comments, original spacing, original key order, and original quote style may change or disappear.
Flatten leaves Each scalar or empty container gets a document number, path, type, and preview value. Path spelling depends on dot or slash style, and array positions become explicit segments.
Emit assignment text Scalar leaves become env, INI, or properties entries. Objects and arrays are not emitted as direct assignment values, and destination loaders may coerce strings differently.

Path and Assignment Rules

Flattened names are addresses back to YAML leaves. They need enough escaping to avoid ambiguity while staying readable for the target format.

Path and assignment conversion rules
Source shape Representative output Review note
Object key servers servers Simple identifier-style keys stay plain in dot paths.
Array item at position 0 servers[0] or servers/0 Array positions are included so repeated items do not collapse into one name.
Key containing spaces or punctuation ["build target"] Dot notation quotes keys that would otherwise be confused with path separators.
Slash-style path with a slash inside a key routes/api\/v1/timeout The slash inside the key is escaped so it is not read as a separator.
Multiple YAML documents DOC2_DATABASE_HOST or doc2.database.host Document prefixes prevent later documents from overwriting earlier names when copied together.
Scalar leaf servers[0].limits.cpu_percent: 80 SERVERS_0_LIMITS_CPU_PERCENT=80 Environment names normalize separators to underscores and can be uppercased with an optional prefix.

Validation Boundaries

Formatting options are bounded so generated output stays readable and browser review remains responsive. Destination-specific validation still belongs to the application that will consume the generated text.

YAML converter validation boundaries
Area Accepted or produced Boundary
Source files .yml, .yaml, YAML MIME hints, and plain text files. Only one selected or dropped file is read into the editor at a time.
Standalone JSON Valid JSON objects or arrays are detected before YAML parsing. They are rejected with a JSON-specific message so YAML review is not bypassed.
YAML indentation Normalized YAML indentation is clamped from 1 to 8 spaces. Changing indentation affects regenerated YAML, not the parsed values.
YAML line width 0 disables wrapping; other values are capped at 240. Wrapping changes presentation and can make long scalars easier or harder to review.
Path preview The visible table uses a 50 to 2000 row preview limit. Path exports can include the full discovered set when the visible preview is trimmed.
Assignment outputs Scalar leaves become env, INI, and properties entries. Nested objects and arrays remain available for inspection but are not direct assignment values.

Worked Transformation Path

A leaf such as servers[0].limits.cpu_percent: 80 passes through the same parsed value before each target format is written.

One YAML leaf across conversion outputs
View Example Meaning
Path servers[0].limits.cpu_percent The leaf is under the first server item, inside limits.
Type number The parsed value is numeric before assignment text is generated.
Env SERVERS_0_LIMITS_CPU_PERCENT=80 The path becomes an uppercase, underscore-separated name.
INI [servers]
0_limits_cpu_percent=80
The first path segment becomes the section and the rest becomes the key.
Properties servers[0].limits.cpu_percent=80 The flattened path stays close to the path table spelling.

Advanced Tips:

  • Turn on Sort YAML keys before comparing regenerated YAML files when stable key order matters more than original authoring order.
  • Use Force YAML quotes when a downstream loader must receive explicit strings, especially for values such as true, null, or numeric-looking IDs.
  • Leave YAML line width at 0 when long scalar values should not wrap in regenerated YAML.
  • Use a short ENV prefix when generated environment names will share a shell, container, or deployment file with other applications.
  • Review Schema after multi-document input; a path with mixed types can break a migration even when each document is valid YAML.

Privacy and Accuracy Notes:

YAML text and selected files are read and converted in the browser session, and normal conversion outputs do not need a server lookup. Entered source text and settings can be reflected in shareable state, so avoid pasting secrets when browser history, copied links, shared devices, or screen sharing are a concern.

Syntax validity does not prove application validity. A destination may reject a generated key, ignore an unsupported setting, coerce a text value into another type, or require quoting rules that are specific to that application.

Worked Examples:

Reviewing a deployment manifest

A manifest with environment.region: us-west-2, two servers items, and nested limits should show one object document in Document Ledger. Paths should include rows such as servers[0].limits.cpu_percent, and Env can produce names like SERVERS_0_LIMITS_CPU_PERCENT=80 after uppercase names are enabled.

Comparing staging and production documents

A stream with two documents separated by --- should show two document rows. If both documents contain database.host as text, Schema should show the path in two documents with one type. In Env and properties-style output, document prefixes keep staging and production assignments separate when copied together.

Checking scalar-only assignment output

A nested branch such as tls: { cert: /etc/cert.pem, key: /etc/key.pem } remains object structure in Paths and Schema, while its scalar leaves can become assignment lines. If a destination expects the whole tls object as one value, use Generated JSON or normalized YAML instead of Env, INI, or Properties.

Recovering from a JSON paste

A paste such as { "service": "api", "tls": true } stops with JSON input detected. Convert that source to YAML first, then check that Document Ledger, Paths, and Schema show the expected root and leaf types before copying a derived format.

FAQ:

Why does a JSON object stop instead of converting?

Standalone JSON objects and arrays are rejected so the page stays focused on YAML review. Convert JSON to YAML first when you want YAML-specific checks such as document markers, indentation, anchors, and aliases.

Why did my comments disappear?

Comments help people read YAML, but they are not values in the parsed data tree. Normalized YAML, generated JSON, paths, and assignment outputs focus on data values that can be represented in target formats.

Why are objects missing from Env, INI, or Properties?

Those outputs include scalar leaves. Objects and arrays stay visible in Document Ledger, Paths, and Schema, but they are not written as direct key-value assignments.

What does a trimmed path preview mean?

The visible Paths table stopped at the current Path preview limit. Raise the limit for more visible rows, or download the CSV when you need every flattened path.

Can I paste secrets into YAML content?

Avoid secrets. Conversion happens in the browser, but entered source text and settings can appear in shareable state, which may be saved in browser history or copied into links.

What should I do when the parser is unavailable?

Reload the page and try again. Do not use normalized YAML, generated JSON, paths, schema, env, INI, or properties output until parsing succeeds.

Glossary:

YAML stream
One YAML input that may contain one or more documents.
Document marker
--- starts a document in a stream, and ... can mark one as ended.
Mapping
A key-value structure, similar to a JSON object.
Sequence
An ordered list of values.
Scalar
A single leaf value such as text, a number, a boolean, a timestamp, binary data, or null.
Anchor
A YAML label that lets later aliases reuse the same value or branch.
Flattened path
A readable address for a nested leaf value inside a document.
Schema
A path summary that compares types and document coverage across parsed YAML documents.

References: