YAML Document Set
{{ metrics.documentCount }} {{ metrics.documentCount === 1 ? 'document' : 'documents' }} {{ metrics.totalKeys.toLocaleString() }} keys {{ metrics.totalScalars.toLocaleString() }} scalars Depth {{ metrics.maxDepth }} Flattened preview trimmed
{{ type }}
{{ warn }}
YAML Document
Use 0 to disable wrapping.
Field Value Copy
{{ row.label }} {{ row.value }}
{{ normalizedYaml }}
{{ iniText }}
{{ envText }}
{{ propertiesText }}
Document Path Type Preview Copy
Doc {{ row.docIndex }} {{ row.path || '(root)' }} {{ formatTypeLabel(row.type) }} {{ row.preview }}
Path Types Docs Example
{{ row.path }} {{ row.types }} {{ row.docs }} {{ row.example }}
:

Introduction:

YAML is a text serialization language used heavily for configuration files, deployment manifests, and structured message payloads. Its meaning lives in indentation, dashes, colons, and document markers, so a tiny formatting change can move a value into a different branch or split one stream into several documents.

Diagram showing a YAML stream splitting into separate documents and then into mappings, sequences, and scalar leaf values.

That human-friendly style is why YAML is popular, and also why it can be easy to misread. One stream may contain several documents separated by ---. It may reuse earlier nodes with anchors and aliases. It may also switch between literal and folded text blocks where line breaks behave differently even though the text still looks tidy.

Good YAML review is not only about making the source look neat. It is about checking how many documents are present, what the tree actually contains, and which leaf values survive when the same source is expressed as JSON, env lines, INI sections, or Java-style properties.

Even valid YAML has limits. A parser can confirm that the text is well formed, but it cannot prove that the destination system accepts every key name, value type, or naming convention that appears after conversion into another format.

Technical Details:

YAML 1.2.2 is built around three core node kinds: mappings, sequences, and scalars. Block indentation, - list entries, and key: value pairs decide where those nodes sit in the tree, while --- starts a document and ... can end one. A conversion workflow therefore starts by loading the YAML stream into one or more native documents, not by swapping characters in place.

Once the tree exists, every target format keeps different parts of it. JSON can carry objects, arrays, strings, numbers, booleans, and null values directly. Env files, INI files, and Java properties files are narrower line-oriented conventions, so nested containers have to be flattened into path-based keys and scalar values end up as text.

Transformation Core

The conversion path is consistent: parse the YAML stream into documents, normalize the document tree, and then derive each output surface from that parsed structure instead of from raw text replacement.

Transformation stages for the YAML converter
Stage What stays intact What can change
Parse YAML stream Document count, nesting, scalar values, and repeated-node references are resolved into a data tree. Comments and original spacing stop being part of the data model.
Normalize YAML The parsed values stay the same. Indent width, line wrapping, key order, quote style, and anchor reuse can change the rendered text.
Serialize JSON Objects, arrays, numbers, booleans, nulls, and strings remain visible as JSON values. A multi-document stream becomes a JSON array, and comments or YAML-only presentation choices disappear.
Flatten paths Leaf locations, document numbers, and detected value types remain traceable. Path spelling changes with the selected dot or slash style.
Build scalar exports Scalar leaf content remains available for copying or download. Objects and arrays do not become direct env, INI, or properties assignments.

YAML formatting controls work on the parsed tree rather than on the raw paste. YAML indent is clamped to 1 through 8 spaces. Line width accepts 0 as a no-wrap choice. Sort keys, Force quotes, and Expand anchors change how normalized YAML is written, but they do not invent new values.

Path And Export Rules

Flattening turns the tree into stable leaf addresses. In dot mode, safe object keys keep dotted segments and array indexes appear as brackets. Keys that would break dot notation are escaped into bracketed string form. In slash mode, each segment is separated by / and literal slashes inside keys are escaped.

How one YAML leaf appears across output formats
Output Example for servers[0].limits.cpu_percent: 80 What to watch
Paths, dot style servers[0].limits.cpu_percent Keeps the array index and field path together for review and copy.
Paths, slash style servers/0/limits/cpu_percent Uses slash-separated segments when that fits the destination better.
Env SERVERS_0_LIMITS_CPU_PERCENT=80 Separators collapse to underscores, multi-document input adds DOCn_, and a user prefix can be added first.
INI [servers]
limits_cpu_percent=80
The first path segment becomes the section name and the rest becomes the key.
Properties servers[0].limits.cpu_percent=80 Keeps the flattened path spelling more closely; multi-document input adds docN..

The string nature of the scalar exports matters. Node.js documents .env files as key-value pairs whose parsed values are text. Python’s configparser treats INI values as strings unless a reader converts them later, and Java properties files are also line-oriented string pairs. That means numbers and booleans can leave YAML faithfully, but they still arrive in these export views as text.

The Schema surface groups flattened paths across all parsed documents. Each row records the path, the types seen there, how many documents contain it, and one example value. Mixed-type rows are especially useful because they reveal places where one document uses a string and another uses an object, array, or number at the same location.

Everyday Use & Decision Guide:

Start with the source exactly as you received it, then run Convert YAML before changing formatting options. The summary badges and Document Ledger are the first trust check. An unexpected document count, an array root where you expected an object, or a sudden jump in Max depth usually means the input needs another look before you copy any derived output.

  • Use YAML when you want a cleaner source file for review, ticket comments, or another editing pass.
  • Use JSON when the next system expects objects and arrays rather than indentation-based syntax.
  • Use Paths when you need exact leaf addresses, and switch Path style before copying if the destination prefers slash segments.
  • Use Schema when you are comparing documents and need to know whether the same path appears in the same type across the whole set.

The scalar exports serve different jobs. Env is useful for environment-style names, INI is useful when a consumer expects sections and simple keys, and Properties is useful when you want the flattened path to stay readable. The common mistake is assuming these exports are full-fidelity rewrites of the YAML tree. They are not. Only scalar leaves become assignments, so objects and arrays disappear as direct output lines.

Multi-document input is handled cautiously. Env adds DOCn_ to path-derived names, and Properties adds docN., which keeps staging and production values from colliding when they come from one paste. That makes side-by-side config comparison easier, but it is still worth checking the Schema table before trusting that two documents use the same field names and types.

If you see Flattened preview trimmed, nothing has been lost from the conversion. The visible table is capped so long documents stay readable. Raise Max preview paths if you need more rows on screen, or export the table and then verify the Types and Docs columns in Schema before treating the export as migration-ready.

Step-by-Step Guide:

A reliable pass starts with structure, then moves to formatting, then to the export that matches the next system.

  1. Paste text into YAML Document or drop a .yml/.yaml file onto the editor. Load sample is useful if you want to confirm the panes before using your own data.
  2. Click Convert YAML. If the page shows JSON input detected. Please provide YAML documents instead. or a YAML parse error, correct the source first because no later pane is trustworthy until parsing succeeds.
  3. Read the summary badges and Document Ledger. Confirm the document count, then scan Top-level keys, Total nested keys, Scalar values, and Max depth for shape changes.
  4. Open YAML and JSON. Adjust JSON spacing, YAML indent, Line width, Sort keys, Force quotes, and Expand anchors only after the parsed shape looks right.
  5. Open Paths and choose the right Path style. If the table is too short, raise Max preview paths; if the warning still says Flattened preview trimmed, use the CSV export for the full row set.
  6. Open Env, INI, or Properties only when you need scalar assignments. Set ENV prefix and Uppercase env before copying if the destination expects a specific naming pattern.
  7. Finish in Schema. Check the Types and Docs columns for paths you care about, then copy or download the output that best matches the next consumer.

When the final check looks good, Apply to editor lets you keep working from the normalized YAML instead of pasting it back by hand.

Interpreting Results:

Trust the parsed structure before you trust any export. The most important question is whether the document tree matches what you intended to send downstream.

  • An unexpected summary badge such as 2 documents or a root type you did not expect means the YAML stream is not shaped the way you thought.
  • A Schema row whose Types cell lists more than one type means the same path changes shape across documents. That is a real compatibility warning, not a cosmetic difference.
  • Flattened preview trimmed limits only the visible Paths table. CSV export still includes every discovered row.
  • Env, INI, and Properties prove that scalar leaves were found. They do not prove that the destination system accepts the generated names or will coerce the text back into the types you expect.

The main false-confidence risk is treating a clean YAML or JSON pane as the same thing as a safe migration target. Before you trust a copied export, compare the path spelling in Paths and the type consistency in Schema for the fields that matter most.

Worked Examples:

Deployment manifest cleanup before review

Suppose a service manifest contains environment.region: us-west-2, servers[0].limits.cpu_percent: 80, and a reused TLS block through YAML anchors. After conversion, Document Ledger should show Document 1 · Object with non-zero Top-level keys, a sensible Total nested keys count, and a Max depth that matches the nested server branch. Turning on Sort keys, leaving YAML indent at 2, and enabling Expand anchors produces a cleaner YAML review copy without changing the values. The Properties pane can then expose lines such as servers[0].limits.cpu_percent=80. That is a good audit view, but it still does not prove the deployment system accepts every field.

Comparing staging and production in one paste

Now take a YAML stream with two documents separated by ---, one for staging and one for production. The summary badge should change to 2 documents, and Document Ledger will add separate rows for Document 1 and Document 2. In Env, a path like database.host becomes DOC1_DATABASE_HOST=staging-db.internal and DOC2_DATABASE_HOST=prod-db.internal when Uppercase env is on. In Schema, the row for database.host should show Types as string and Docs as 2. That tells you the same field exists in both documents and can be compared without key collisions.

When parsing stops before any table appears

If you paste { "service": "api", "tls": true }, the run stops with JSON input detected. Please provide YAML documents instead. and neither Document Ledger nor Paths is populated. The corrective path is to convert that source into actual YAML such as service: api and tls: true, then run the conversion again. Once parsing succeeds, Document Ledger should reappear and Paths should show leaf entries for service and tls.

FAQ:

Why does it reject JSON when YAML 1.2 can represent JSON?

YAML 1.2 became a strict superset of JSON, but this converter checks for standalone JSON before parsing and stops with a YAML-only error on purpose. That keeps YAML review separate from JSON review, especially when document markers, anchors, and indentation are the parts you are trying to inspect.

Why do some values show up in Paths but not in Env or INI?

Because Env, INI, and Properties are scalar exports only. Objects and arrays still affect Document Ledger, Paths, and Schema, but they are not emitted as direct assignment lines.

Why did my variable names change shape?

Path-derived env names are normalized by replacing separators with underscores, removing unsupported characters, optionally uppercasing the path portion, and adding DOCn_ for multi-document input. INI sections also normalize names. If you need the original flattened spelling to stay visible, copy from Paths or use Properties.

What does Flattened preview trimmed mean?

It means the on-screen Paths table stopped at the current Max preview paths limit so the page stays readable. It does not mean path rows were dropped from CSV export or from the internal flattened result set.

Why am I seeing YAML parser unavailable. Please reload and try again.?

The parsing library did not finish loading, so no conversion can start. Reload the page and make sure the browser can reach the parser script. If the library is blocked, the YAML, JSON, Paths, and Schema panes cannot be generated.

Does my YAML leave the browser?

The pasted document is parsed, flattened, copied, and downloaded in the browser session, and this tool does not post the YAML to a helper endpoint. The page does load its parser library from a CDN before conversion begins, so privacy-sensitive work should take normal care with the browsing environment itself.

Glossary:

Document marker
The --- or ... line that starts or ends a YAML document inside a stream.
Anchor
A named YAML node marked with & so later content can point back to it.
Alias
A later reference marked with * that reuses an anchored node.
Scalar
A single value such as a string, number, boolean, or null rather than a mapping or sequence.
Flattened path
A text address that shows how to reach one value from the root of a parsed document.
Schema row
A grouped view of one path, the types found there, the number of documents that contain it, and one example value.