YAML Converter
Convert YAML into JSON, env, INI, properties, and path tables with local parsing, document checks, schema review, and scalar-only exports.YAML converted
| 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.
|
||||
Introduction:
Configuration data often has to move between people-friendly review files and stricter machine formats. A service manifest may begin as YAML because indentation makes nested settings readable, then need JSON for an API payload, environment variables for a container, INI for a legacy application, or a path list for an audit note.
YAML earns its place in that workflow by making mappings, sequences, and scalars compact. The same compactness is why conversion deserves a careful read. A colon turns text into a key-value pair, a dash starts a list item, indentation decides parent and child relationships, and a document marker can divide one pasted stream into several separate documents.
- Mapping
- A key-value structure, such as
database.host: db.internal. - Sequence
- An ordered list, often written with one dash-prefixed item per line.
- Scalar
- A single value such as text, a number, a boolean, a timestamp, binary data, or null.
Several YAML details affect the output more than they first appear:
- Comments help reviewers, but they are not data values in the converted tree.
- Anchors and aliases can reuse earlier content, so repeated settings may not appear twice in the source text.
- Block strings preserve or fold line breaks depending on their marker, which can change how a secret, certificate, or message reads after conversion.
- Multiple documents separated by
---should be reviewed as a stream, not as one merged object. - Plain scalars can become typed values, so a destination may treat
true,80, ornulldifferently from quoted text.
Target formats do not all keep the same information. JSON can represent nested objects and arrays, though it will not carry YAML comments or original spacing. Environment files, INI, and Java properties are assignment-oriented text, so they work best for scalar leaves rather than whole nested branches. Path and schema summaries are review aids: they expose where values live, which documents contain them, and where a path changes type.
| Target | Best fit | Main caution |
|---|---|---|
| JSON | Structured data exchange when objects, arrays, booleans, numbers, and nulls must remain typed. | YAML presentation details such as comments and original quoting are not part of the JSON value model. |
| Normalized YAML | Reviewing the parsed structure with consistent indentation, wrapping, key order, and anchor handling. | Formatting changes can make a file look different even when the parsed values are unchanged. |
| env, INI, properties | Line-based configuration targets that expect key-value assignments. | Names are flattened and values become text, so the receiving application decides final typing. |
| Paths and schema view | Auditing nested leaves, document coverage, and type consistency before migration. | A tidy path list does not prove that another platform accepts the generated key names. |
Valid YAML syntax is only the first gate. The converted text still needs a destination-specific check for reserved names, required sections, value typing, duplicate meaning, and secrets that should not be placed in flat configuration files.
How to Use This Tool:
The converter updates after each edit, so start with the source text and then verify the parsed shape before copying generated output.
- Paste source into
YAML content, drop one.yml,.yaml, or text file onto the editor, or chooseBrowse file. - Stop on an error message.
JSON input detected,YAML parse error, andYAML parser unavailableall mean the output tabs are not ready to trust. - Read the summary badges and
Document Ledgerfirst. Confirm the document count, root type, top-level keys or items, total nested keys, scalar count, and maximum depth. - Open
Advancedbefore copying normalized YAML or JSON. SetJSON spacing,YAML indent,YAML line width, key sorting, forced quotes, and anchor expansion to match the review or destination requirement. - Choose
Path separatorandPath preview limitbefore usingPathsorSchema. Dot notation is easier for object-style review; slash segments are better when another system expects path parts. - Use
ENV prefixandUppercase env keysbefore copyingEnv. ReviewINIandPropertiesfor flattened names, especially when the YAML has arrays or punctuation-heavy keys. - Finish in
Schema. A path that appears in fewer documents than expected, or shows more than one type, should be fixed or explained before the generated text is reused.
Interpreting Results:
Read the parsed shape before reading the converted text. The most useful confidence checks are document count, root type, scalar count, flattened path spelling, and type consistency across documents.
Document Ledgerconfirms whether the source became one document or several, and whether each document starts as an object, array, scalar, or empty value.YAMLandJSONshow full structured output. They can preserve values and nesting, but not YAML comments or the exact original layout.Pathsshows leaf addresses, document numbers, types, and previews. A trimmed on-screen preview affects only the visible table; CSV export still uses the full path set.Schemagroups paths across documents. Mixed types on the same path usually deserve review before migration.Env,INI, andPropertiesinclude scalar leaves. Nested objects and arrays are inspected through paths and schema, not emitted as direct assignment values.
A clean conversion does not prove that a deployment platform, application loader, or secrets manager will accept the result. Test the copied text with the destination parser, and double-check generated names when paths contain array indexes, quoted keys, document prefixes, or punctuation.
Technical Details:
YAML conversion is a parse-then-serialize problem. YAML 1.2.2 describes a stream as one or more documents, and each document resolves to a graph of mappings, sequences, and scalars. Indentation, indicators, anchors, aliases, and scalar style affect that graph before any output format is generated.
JSON represents structured values with objects, arrays, strings, numbers, booleans, and null. It is a good target when the nested tree should remain machine-readable. Assignment formats are narrower: environment files, INI files, and Java properties generally communicate names and string values, so the conversion must flatten paths and skip direct object or array assignments.
Transformation Core
The source text is first parsed into document values. Every later view is derived from those values rather than from string substitutions in the original YAML.
| Step | What carries forward | What needs review |
|---|---|---|
| Parse the stream | Document boundaries, root value, nested keys, list positions, scalar values, aliases, and empty values. | Invalid indentation, unresolved syntax, or a standalone JSON object or array stops conversion. |
| Summarize documents | Root type, top-level counts, nested key totals, scalar totals, maximum depth, and sample values. | A root scalar or unexpected array can be valid YAML but unsuitable for a configuration target. |
| Serialize structured output | JSON and normalized YAML keep the parsed tree visible for review. | Comments, 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 path segments. |
| Emit assignment text | Scalar leaves become env, INI, or properties lines. | 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, not a universal standard. They need enough escaping to point back to the same YAML leaf, while still staying readable for the target format.
| 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
The converter enforces practical bounds around formatting options and preview size, then leaves destination-specific validation to the system that will consume the generated text.
| 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 the rendered YAML copy, not the parsed values. |
| YAML line width | 0 disables wrapping; other values are capped at 240. |
Line 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 CSV export uses the full flattened set, even when the visible preview is trimmed. |
| Assignment exports | 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.
| 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. |
Formula Core is not used here because the job is structural transformation rather than arithmetic. The critical technical checks are parsing, path construction, scalar selection, and type consistency.
Privacy and Accuracy Notes:
YAML text and selected files are read and converted in the browser session. The converter does not upload the source YAML for conversion, but changed form values can be reflected in the page address for sharing and embedding. Avoid pasting secrets if browser history, copied links, screen sharing, or shared devices are a concern.
Syntax validity does not prove application validity. A destination may reject a generated key, ignore an unsupported setting, change 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 the uppercase option is applied.
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, document prefixes keep staging and production assignments separate when copied together.
Checking scalar-only exports
A nested branch such as tls: { cert: /etc/cert.pem, key: /etc/key.pem } appears as 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 JSON or normalized YAML instead of env, INI, or properties text.
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, JSON, paths, and assignment outputs focus on the 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 changed form values can appear in the address bar and share/embed fields, 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. No normalized YAML, JSON, path, schema, env, INI, or properties output should be used 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 view
- A path summary that compares types and document coverage across parsed YAML documents.
References:
- YAML 1.2.2 Specification, YAML Language Development Team, 2021-10-01.
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format, IETF, December 2017.
- DotEnv files, Node.js documentation.
- configparser, Python documentation.
- Properties, Java Platform documentation.