WebCodeIn

YAML Formatter

Format and validate YAML instantly — with clear error locations.

Formatted locally in your browser — nothing is sent to a server.

Input
11 lines170 charsValid
Output
7 keys11 lines170 charsValid

About this tool

Paste or upload YAML to reformat it with your choice of indentation, sort mapping keys alphabetically, or switch to compact flow style. Invalid YAML is reported with the exact line and column the parser flags, so you can find the problem without scanning the whole document.

Frequently asked questions

What does this tool actually check?
It parses your input with js-yaml's default safe schema — the same parser used everywhere else in the ecosystem — so anything it accepts is valid YAML, and any error message and line/column position come directly from the parser, not a re-implementation.
Is my YAML sent to your servers?
No. Formatting and validation both happen in your browser. Nothing you paste, upload, or generate here is sent to WebCodeIn's servers, logged, or stored.
Is it safe to format YAML from an untrusted source?
Yes — this tool uses js-yaml's default safe schema, which never evaluates dangerous tags like !!js/function. Only plain data (mappings, sequences, and scalars) is ever produced.
What does "Flow style" do?
It forces YAML's compact, JSON-like representation — {a: 1, b: [1, 2]} instead of the multi-line block style — which is YAML's closest equivalent to "minifying" the output. It's valid YAML either way; only the layout changes.
Can I format YAML that isn't a mapping, like a bare list or scalar?
Yes — any valid YAML document is accepted, including a top-level sequence, string, number, boolean, or null.

Privacy

Every parse and format operation runs in your browser using js-yaml’s safe schema. No configuration, request, or generated value is sent to WebCodeIn’s servers, logged, or stored.

Related tools