Trexmi
Validator Ready

YAML Validator

Check a practical YAML subset for indentation, mappings, sequences, duplicate keys, quotes and scalar syntax, with explicit unsupported-feature errors.

Validate mappings and sequences Require space-based two-column indentation Detect duplicate mapping keys Parse quoted and plain scalars
INPUT YAML document to validate *
0 chars0 words0 lines
Paste the source value for this specific transformation. Example: Trexmi developer sample
Ctrl / ⌘ + Enter
Validation result
About the tool

What YAML Validator does

YAML Validator checks common configuration-style YAML made from mappings, sequences and scalar values. It detects empty or duplicate keys, mixed mapping and sequence blocks, invalid nesting, tabs, odd indentation and broken quoted strings.

This validator intentionally supports a practical subset rather than the entire YAML 1.2 language. Indentation must use multiples of two spaces. Anchors, aliases, custom tags and block scalars are rejected with a clear message. This boundary prevents a simple result from being presented as full YAML conformance.

YAML Validator checking indentation, mappings and sequences
Use the result for a quick syntax check, then test the destination parser.

How to use

  1. Paste the whole document. Include the surrounding mapping or sequence, not only the suspected line.
  2. Run validation. Empty input, tabs and unsupported advanced features are checked before block parsing.
  3. Follow the line message. Correct indentation, duplicate keys, mixed block types or quoted-scalar syntax.
  4. Run again. The validator returns Valid YAML only after the supported document parses completely.
  5. Use the real parser. Validate the corrected file with the application, CI tool or library that will consume it.
Built for the task

Why use YAML Validator?

Focused controls, predictable output, and a workflow designed around this exact transformation.

01

Block-structure checks

Detect invalid nesting and mixed sequence/mapping content with source line context.

02

Duplicate key detection

Reject a repeated key within the same mapping instead of silently keeping one value.

03

Scalar parsing

Check null, boolean, number, quoted text and JSON-style inline collection syntax.

04

Honest feature boundary

Advanced YAML constructs are rejected rather than incorrectly reported as valid.

Useful answers

Questions about YAML Validator

Practical details about input, output, privacy, limits, and the best way to use this tool.

01 Does this validate all YAML 1.2 features?

No. It validates a documented subset intended for common mappings, sequences and scalar configuration data.

02 Which indentation is accepted?

Indentation must use spaces in multiples of two. Tabs and odd numbers of leading spaces are rejected.

03 Are anchors and aliases supported?

No. Anchors, aliases and custom tags are rejected explicitly.

04 Are block scalars supported?

No. Literal and folded block scalars using | or > are outside the supported subset.

05 Are comments allowed?

Blank lines, full-line comments and ordinary inline comments are supported within the practical parser rules.

06 Can it parse inline arrays and objects?

Yes when the inline collection uses valid JSON-style syntax.

07 Does it detect duplicate keys?

Yes within each parsed mapping block.

08 Why must I validate again in the destination?

Your application may support a broader YAML feature set or apply different schemas and type resolution.

Supported YAML structure

The validator handles indentation-based mappings, dash-prefixed sequences, nested blocks and scalar sequence items. Sequence items may also begin a mapping. A block cannot mix mapping and sequence entries at the same indentation level.

Scalar handling

Null, true, false, integers and simple decimals are parsed as values. Single- and double-quoted strings are checked for closure. Plain strings are supported, and inline collections must use JSON-style brackets, braces and quoting.

Indentation and duplicate keys

Tabs are rejected because their display width is ambiguous. Each indentation level must be a multiple of two spaces. Within a mapping, a key cannot be empty or appear twice. These stricter rules are useful for Trexmi output but do not describe every valid style permitted by the YAML specification.

Unsupported advanced features

Anchors, aliases, custom tags and literal or folded block scalars are outside this validator. A rejection for one of these constructs does not necessarily mean the document is invalid YAML; it means a full-featured YAML parser is required.

Continue the workflow

Start from JSON to YAML when you need straightforward compatible YAML. If the document describes an API contract, run OpenAPI Validator after fixing YAML syntax. Use JSON Validator to isolate syntax problems in an equivalent JSON serialization.

Specification and privacy

Consult the YAML 1.2.2 specification or the documentation for your production parser when full conformance matters. Remove passwords, tokens and other secrets from configuration samples before using an online utility.