YAML / TOML / ENV Config

YAML formattertidy configuration without losing its notes

Format the whole stream, then download one document only when you need it.

YAML formatter

Current YAML

Format reads this document and, after the whole stream checks out, writes it back. Pasting, typing, and changing indentation or document scope do not rewrite it. Structure and anchors are read-only.

Ctrl/Cmd+Enter: Format

Enter YAML or choose an example.

Formatting options

Copy and Download export the full current document. Download this document exports only the selected document and does not replace the editor.

The first input allows 500,000 UTF-16 units, 100 documents, depth 100 and 50,000 nodes. A generated document can continue up to 2,000,000 units.

Original

Processed in this browser. Your YAML is not uploaded. Undo and redo cover edits, formatting, the example, clearing, and restoring the original. Options are not history steps.

Use this YAML formatter before reviewing configuration that has accumulated inconsistent indentation. The output stays YAML, including the comments that explain why a setting exists and the anchors that connect reused values.

Format writes the checked stream back into the current document. Copy and download that full document. Choosing one document downloads only that part and leaves the editor unchanged.

Why use this YAML formatter?

Keep explanations beside the settings

Formatting rewrites the current document from its nodes, keeping comments, anchor names and original number text. It does not pass through JSON. Whitespace and some string spellings can still change.

Indented configuration lines retain colored comment marks and a matching numeric sequence.

Choose a document after checking the stream

Every document is checked before the stream is written back. Download this document exports one part only and does not replace the editor. An error in any document still blocks both actions.

Two separated document cards lead to a selected output card, with references confined to each source card.

Inspect the scope before exporting

01

Format the stream you see

Format checks every document, then writes the whole stream back. Indentation applies only to the next format. Pasting and changing options do not rewrite the text.

02

Use the shortcut while editing

Ctrl/Cmd+Enter formats the current document. Undo restores the previous document, including manual edits. Example and Clear start a new document and can be undone.

03

Keep export scope explicit

Copy and Download export the full current document. After you select one document, Download this document exports only that formatted part and does not replace the editor. Structure and anchor lines follow the current document.

Read the hierarchy and its references

Consistent two- or four-space indentation

Choose two or four spaces for the next format. The current document changes only when formatting succeeds. Block strings stay scalar values and are not executed.

Duplicate keys stop the whole stream

The YAML validator checks every document before returning output. Repeated scalar keys are compared by their Core meaning, including numeric spellings, rather than allowing a later value to overwrite an earlier one. The error identifies the input location. A YAML beautifier still checks every document before rewriting the current one.

Precision stays in the number text

Large integers and long decimal fractions keep their original numeric tokens instead of being rounded through a browser Number. Scientific notation and non-finite YAML values remain YAML. This does not guarantee that another application will parse them with equal precision.

Browse structure without expanding aliases

Read mapping, sequence and scalar nodes with their source lines and document numbers. The reference view lists anchor declarations and alias targets. Summaries load in batches of 50; viewing a cyclic alias does not recursively duplicate its target.

Accepted syntax and explicit limits

A fixed Core schema
YAML 1.2 Core governs values: plain yes, no, on and off are strings. Other version directives and unsupported tags are rejected. Mapping keys may be string, number, boolean or null scalars; collection and alias keys are outside this tool’s scope.
References stay inside their document
Aliases retain their names instead of expanding into copied values. A self-reference may remain as a reference; undefined and cross-document aliases fail. The key << is ordinary Core data here and is never interpreted as a merge operation.
Formatting cannot repair an unknown hierarchy
Invalid indentation, duplicate keys or errors in any document block the output. The tool does not guess a repair, sort keys, minify, convert formats or validate Kubernetes and CI schemas. Whitespace and scalar presentation may change; byte-for-byte preservation is not promised.
Budgets are enforced before export
The first input allows 500,000 UTF-16 units, 100 documents, depth 100 and 50,000 nodes. A generated document can continue up to 2,000,000 units. Over the limit, processing stops without a truncated download.

YAML formatter questions

Will formatting retain my comments?

Yes. Comments are kept on the document model and written into the output. This YAML formatter does not take a YAML → JSON → YAML route, which would lose comments. Review the separate output because indentation and other presentation details can still change.

Can I adjust indentation?

Choose two or four spaces below the editors. Tabs are not an available indentation style. If the source cannot be parsed, selecting a different width will not guess how its hierarchy was intended to look.

How are several YAML documents handled?

The default exports the whole stream. Select a numbered document to export just that resource. Every document must pass syntax and duplicate-key checks first; an error in a different document still prevents exporting the selected one.

Will formatting alter values?

The formatter retains numeric tokens, comments and references while rewriting presentation. Types follow YAML 1.2 Core, so compatibility with a YAML 1.1 consumer requires a separate review. Quote an identifier if it should be text rather than a number.

Does syntax checking include application schemas?

No. A parsed mapping can still contain an invalid Kubernetes field or an incorrect workflow option. Format YAML online here to inspect syntax and layout, then use the application’s own validator before applying a configuration.

Found a configuration this tool handles incorrectly?

Return to the YAML formatter

Use the YAML formatter to compare indentation, check the document selection and export the current result.