{{ summaryHeading }} {{ summaryPrimary }} {{ summaryLine }} {{ badge.label }}
YAML source and formatting profile
Paste up to 120,000 characters, or load one local YAML, YML, or text file.
{{ sourceStatus }}
Review preserves key order, Diff-stable sorts keys, and Quoted strings protects string-looking scalars.
  • {{ warning }}
Use 1 through 8 spaces. Two spaces matches the default Review profile.
spaces
Use 40 through 240 columns, or zero for no wrapping.
columns
Alphabetical key order can stabilize diffs but may obscure intentional review order.
{{ sort_keys ? 'Enabled' : 'Disabled' }}
Emit repeated structures inline instead of allowing generated alias references.
{{ expand_aliases ? 'Enabled' : 'Disabled' }}
Quote non-key strings for destinations where plain scalar typing needs extra review.
{{ force_quotes ? 'Enabled' : 'Disabled' }}
Choose the preferred delimiter for quoted scalar values.
Enabled by default for editor- and POSIX-friendly text files.
{{ final_newline ? 'Enabled' : 'Disabled' }}
{{ artifactExportStatus }}
{{ values.formatted_yaml }}
{{ tableExportStatus }}
DocumentPathTypePreviewCopy
{{ row.document }}{{ row.path }}{{ row.type }}{{ row.preview }}
{{ chartExportStatus }}

Reformatting a YAML manifest can produce cleaner indentation and a noisier review at the same time. The result may remain structurally valid while losing comments, document markers, or a carefully chosen key order. YAML carries both data and presentation, and only some presentation details survive after the data has been parsed and emitted again.

The data model has three main node kinds. A mapping associates keys with values, a sequence keeps an ordered list, and a scalar holds one value such as a string, number, Boolean, date, or null. Indentation shows nesting in block-style YAML, so a misplaced space can move a node or cause parsing to fail.

Document
One independent YAML value. A stream may contain several documents separated by ---.
Anchor and alias
An anchor names a node with &name; an alias such as *name refers to it again.
Plain scalar
An unquoted value whose type is resolved by the YAML schema. Quoting can make string intent clearer, but it does not undo a type already chosen during parsing.

Formatting is therefore best treated as a controlled parse-and-dump operation, not a cosmetic text edit. It is useful for standardizing indentation, sorting mapping keys for stable diffs, expanding repeated references, or making string values visibly quoted. It is a poor choice when comments or exact source layout must be preserved byte for byte.

YAML changes that formatting preserves or normalizes
Source feature After parse-and-dump formatting Review concern
Mappings, sequences, and scalar values Re-emitted from the parsed data Confirm resolved types and paths.
Comments Removed Do not overwrite documentation-heavy source without a diff.
Anchors and aliases May be renamed, preserved as generated references, or expanded Expansion can make the file much larger.
Flow style and quote choices Normalized to the selected output style The text changes even when the data does not.

A clean-looking file is not proof that an application accepts it. Schemas, required fields, duplicate-key policies, custom tags, and product-specific constraints still belong to the receiving system. Compare the formatted result with the original before replacing configuration that is already in use.

How to Use This Tool:

Start from the kind of handoff you need, then review both the text change and the parsed structure.

  1. Paste YAML or load a local .yaml, .yml, or text file. Fix any line-and-column parse error before choosing formatting refinements.
  2. Choose Review workspace to retain parsed key order, Diff-stable handoff to sort mapping keys, or Quoted strings to quote string values. Select Custom settings for indentation, line width, alias expansion, quote style, and final-newline control.
  3. Check Formatted YAML against the source. Pay special attention when warnings report comments, directives, anchors, tabs, or a truncated structure ledger.
  4. Use Structure ledger to verify important paths and resolved types. Apply the output only after the changed text and the receiving application's own validation both look correct.

Interpreting Results:

A successful result proves that the stream parsed under the supported YAML model and stayed within the inspection limits. It does not prove that Kubernetes, a CI service, or another application accepts the document.

  • Changed means the emitted text differs from the normalized source, including a final newline.
  • Paths and node types reveal structural changes that a visual indentation check may miss.
  • A comment, directive, or alias warning is a stop-and-diff cue before replacing the original file.

Technical Details:

YAML formatting first composes each document into native data, inspects the resulting graph, and serializes that data into a new character stream. Presentation details that do not belong to the composed data cannot be recovered by the serializer.

Transformation Core:

YAML formatter transformation stages
Stage Mechanism Visible effect
Normalize text Convert CRLF and CR line endings to LF. Line-ending-only differences may disappear.
Parse stream Read each YAML document and resolve its nodes. Syntax errors stop the result; comments are not data nodes.
Inspect graph Count mappings, sequences, scalars, depth, repeated references, and scalar or empty-container paths. The ledger shows resolved structure rather than original source tokens.
Serialize documents Apply indentation, wrapping, sorting, reference, quoting, and final-newline rules. Multiple documents are joined with ---.

Formatting Rule Core:

YAML formatting profiles and exact settings
Profile Indent Line width Key order String quoting
Review workspace 2 spaces 100 columns Preserved after parsing As needed
Diff-stable handoff 2 spaces No wrapping target Sorted recursively As needed
Quoted strings 2 spaces 100 columns Preserved after parsing Single-quoted by default
Custom settings 1 to 8 spaces 0 or 40 to 240 columns Preserve or sort Optional single or double quotes

A custom line width of 0 disables the wrapping target. Expanding aliases emits repeated structures inline instead of generated references; this improves standalone readability in some handoffs but can sharply increase output size.

Inspection Bounds:

YAML formatter limits
Boundary Maximum Behavior at the boundary
Source length 120,000 characters Larger text is rejected.
Documents 20 A longer stream is rejected.
Parsed nodes 10,000 Inspection stops with an error.
Nesting depth 80 levels Deeper input is rejected.
Ledger rows 500 Formatting continues, but only the first scalar or empty-container paths are listed.

Privacy and Source Preservation:

Parsing, formatting, and local-file loading happen in the browser; the YAML is not uploaded or executed. Local processing protects transmission privacy, but it does not make a destructive overwrite safe.

  • Comments are removed, directives and exact document markers may be normalized, and aliases may be rewritten.
  • Custom tags or application-specific schemas may behave differently in the receiving system.
  • Keep the original file and review a diff before applying output to active configuration.

Worked Examples:

Two-document diff-stable handoff

For z: 1, a: 2, a document marker, and a second mapping containing items: [one, two], the diff-stable profile sorts the first mapping to a then z. It keeps two documents, expands the flow sequence into block items, and emits a final newline.

Quoted custom output

With four-space indentation, sorted keys, forced double quotes, and no final newline, a string value such as api becomes "api" while numeric 1 stays numeric. The visible text changes, but the ledger still reports the same mapping paths and scalar types.

References: