Format and syntax-check YAML
Parse the current YAML in the Browser, check syntax errors with line and column numbers, then format it or convert it to JSON.
Opens YAML formatting, syntax checking, and JSON conversion toolConclusion: Start with the first error and the next higher-level hierarchy
When syntax checking runs, the current tool displays an error code, Japanese message, parser details, line and column, relevant line, and caret. Use the Jump button to move to the input location and compare siblings at the same hierarchy and whitespace counts.
Common causes include tabs, incorrect indentation, colons in mappings, dashes in sequences, missing closing quotes or brackets, extra indentation in block scalars, and duplicate keys. Do not conclude based only on the message; check the surrounding area.
Narrow down where to check based on symptoms
| Symptom | Main candidates | What to check first |
|---|---|---|
| BAD_INDENT | Space count and Tab | Sibling at the same hierarchy level |
| MISSING_CHAR | Missing Quote or Bracket | Previous Scalar |
| DUPLICATE_KEY | Duplicate Keys in the same Mapping | Displayed row and same-name Key |
| UNRESOLVED_TAG | Custom Tag | Tag definitions and where they are used |
| Unexpected token | Symbol and structure damage | Display position from the previous line |
Recheck after the fix
When the parser stops at the first error, subsequent errors may not yet be displayed. Recheck each time you fix one location, and once errors reach zero, compare the formatted result with the original data.
What can be checked with DevelopTools' YAML tool
The tool parses pasted YAML and .yaml/.yml files in the browser using yaml 2.9.0. It switches between YAML 1.2 core and 1.1, formats YAML, checks syntax, and converts YAML to JSON.
| Item | Support in the current Tool |
|---|---|
| Input | Paste, select a .yaml or .yml file, drag & drop one file |
| plastic surgery | 2 or 4 spaces; preserve line endings, LF, or CRLF; no line width, 80, or 120; and a trailing newline |
| verification | Line, column, and character position; excerpts and carets; error and warning lists; duplicate key detection |
| structure | Comments, blank lines, anchors, aliases, multiple documents, and block scalars |
| conversion | YAML → JSON. Output a single document as a value and multiple documents as an array |
| Unsupported | JSON→YAML, schema validation for Kubernetes and similar systems, custom tag execution, and fetching external references |
Comment positions may change after formatting. JSON conversion loses comments, anchor names, and YAML-specific expressions, so compare the original file and result.
Separate YAML syntax from service-specific rules
When the YAML Parser determines that input is Valid, it means that it can be read as grammar such as Mapping, Sequence, Scalar, and Indentation. It does not determine whether apiVersion exists, whether required keys are present under GitHub Actions jobs, or whether it conforms to the Compose Specification.
For Kubernetes, separately check kubectl server-side or client-side validation; for GitHub Actions, workflow syntax; and for Docker Compose, the Compose Specification and runtime errors. Fix YAML syntax first, then proceed to destination-specific validation to make it easier to isolate the cause.
“Valid YAML” is not the same as “valid configuration for Kubernetes, GitHub Actions, or Docker Compose.”
Common procedure for safely isolating syntax errors
- Duplicate the original YAML and mask Access Tokens, Passwords, Secrets, and similar values.
- Choose YAML 1.1 or 1.2 according to the target environment, then syntax-check first.
- Check not only the first error line and column but also the preceding indentation, Quote, Colon, and Dash.
- Fix one location and recheck, then proceed to the new error location.
- If necessary, convert to JSON and verify the parent-child relationships of Mapping and Sequence with brackets.
- After syntax is valid, validate semantics with destination-specific validators or execution commands.
The position where the Parser stopped may not be the character that broke the structure, but where parsing could no longer continue. Also check the previous line and the next higher hierarchy.
Notes for handling confidential and large YAML files
Input, file loading, parsing, formatting, JSON conversion, copying, and saving are completed in the browser. LocalStorage stores only settings such as indentation, line breaks, YAML version, theme, font, and editor size; it does not store YAML content or processing history.
Processing prioritizes Web Workers. Syntax highlighting in the editor is omitted for input exceeding 500,000 characters, but formatting, validation, and conversion continue. Because all input, syntax trees, and output are retained in memory, the processable size depends on available device and browser memory.
- Mask Secrets, Tokens, connection strings, and personal information before sharing.
- Split large files into separate documents, and close other heavy tabs
- Keep the original file and compare differences in the result saved under a different name
- Do not assume the tool executes or retrieves custom tags or external resources
Primary sources for YAML and destination specifications
Use the official YAML 1.2.2 specification for YAML grammar and the official yaml Documentation for Parser behavior. For Kubernetes, GitHub Actions, Docker Compose, and yq, check their respective official Documentation for specific structures and Commands.
Example: Find a missing closing quote from a line and column
Use YAML where the error occurs on the line after name: "billing. First, retain the original data and replace secrets and similar values with test values.
Return to immediately before the displayed line, close the double quote, and check again. Finally, check scalar values, the key on the next line, error count, and destination validation, and compare before and after to ensure no unintended value changes.
- Paste YAML or load one .yaml or .yml file.
- Choose YAML 1.2 or 1.1 according to the destination and check syntax.
- Check around the location indicated by the line, column, and caret.
- Fix one location and inspect the hierarchy with JSON conversion if needed.
- After rechecking and confirming validity, save under a different name.
Formatting and JSON conversion are not automatic repair. Compare the conversion result with the specification, original data, and destination validator.
Frequently asked questions
- Is the entered YAML sent to a server?
- It is not sent. Input, file loading, parsing, formatting, JSON conversion, copying, and saving are processed in the browser. Only display and formatting settings remain in LocalStorage.
- If syntax checking is Valid, will it also work in Kubernetes or GitHub Actions?
- Not guaranteed. After validating YAML syntax, destination-specific validation is required, such as Kubernetes API, GitHub Actions Workflow Syntax, or Compose Specification.