JSON and YAML tools
Validation, conversion and common pitfalls — all in the browser.
Why this collection exists
JSON and YAML are the default formats of modern API, container and orchestration work. Kubernetes manifests, GitHub Actions workflows, docker-compose files and most application configs live in one or the other. They look interchangeable but the details bite: an extra comma, a wrong indentation or a duplicate key can block an entire deploy.
This collection groups the two calculators ToolsOps ships today for that daily work: a JSON validator with format and minify, and a bidirectional YAML ↔ JSON converter. Both run entirely in your browser. We do not upload your input to any server, we do not store it and we do not send it to third parties: that is the contract.
If you need to understand why a parser rejects your file, the common-errors section below covers the seven most frequent ones. If you want technical depth (YAML anchors, big numbers, JSON Schema, pre-deploy validation), the linked editorial guide rounds it out.
JSON vs YAML at a glance
| Aspect | JSON | YAML |
|---|---|---|
| Format | Strict text with braces and brackets | Indentation-based text, more readable |
| Best for | HTTP APIs, programmatic payloads, service-to-service exchange | Human-edited config: Compose, Kubernetes, GitHub Actions |
| Allows comments | No | Yes, with # |
| Common pitfalls | Trailing commas, unquoted keys, precision loss on very large integers | Inconsistent indentation, implicit booleans on YAML 1.1 (yes/no/on/off), unintuitive anchors/aliases |
| Recommended tool | JSON validator | YAML ↔ JSON converter |
Tools in this collection
The two utilities published today. Both work offline after the first load because they do not depend on any backend or external service.
- Online JSON validator and formatter
Validate, pretty-print or minify JSON in your browser. Errors show line and column whenever the browser exposes them. Nothing leaves your tab.
- YAML to JSON and JSON to YAML Converter
Convert YAML to JSON and JSON to YAML in your browser. Nothing is sent to a server, no tracking, with clear error reporting.
Common mistakes and how to fix them
The seven errors that block a deploy or a PR most often. Paste the case into the matching tool to verify it instantly.
Trailing comma in JSON
Symptom: The parser throws «Unexpected token ]» or «Unexpected token }». Strict JSON does not allow a comma after the last element.
How to fix it: Remove the dangling comma. If you need trailing commas for cleaner diffs, consider JSON5 or switch the file to YAML, which does allow them.
Comments in JSON
Symptom: Lines with // or /* */ produce a parse error. Standard JSON has no comments, even if some lenient parsers tolerate them.
How to fix it: Move the comment into a dedicated field ("_comment": "…") or switch to YAML, which supports # natively.
Unquoted keys
Symptom: { name: "Anna" } fails because JSON keys must be wrapped in double quotes. The error usually reads «Unexpected token n» or similar.
How to fix it: Wrap every key in double quotes: { "name": "Anna" }. Do not use single quotes.
Duplicate keys
Symptom: The parser accepts the file but only keeps the last value of each duplicated key. The bug is silent and reproduces as data loss in production.
How to fix it: Rename or consolidate keys. JSON.parse keeps the last occurrence, so use a dedicated duplicate-key detector if your contract must reject duplicates.
Big numbers and precision
Symptom: An integer like 9007199254740993 rounds to 9007199254740992 when parsed, because JavaScript stores every number as a double-precision float.
How to fix it: Treat the field as a string in JSON ("id": "9007199254740993") or use the parser's bigint option when available. JSON has no arbitrary integer type.
Inconsistent YAML indentation
Symptom: YAML rejects the file with a cryptic error («could not find expected ':'», «mapping values are not allowed here»). The usual cause is mixing tabs and spaces or changing the indent width.
How to fix it: Use spaces only (2 or 4) and keep the same width across the whole file. Configure your editor to show invisible characters when the file is repetitive.
Implicit booleans in YAML 1.1 (yes/no/on/off)
Symptom: The string «yes» silently becomes true. Same with no, on, off, y and n in YAML 1.1, the version many parsers still use.
How to fix it: Quote the value explicitly: "yes" wrapped in quotes. If you control the parser, configure YAML 1.2, which restricts booleans to true/false.
JSON and YAML best practices
When to pick each format, common errors in depth, YAML 1.1 vs 1.2 gotchas, anchors/aliases, big numbers and why client-side validation matters.