snaptxt.app

YAML ↔ JSON Converter

Convert YAML to JSON or JSON to YAML with multi-document support, indentation control, and live error reporting. Free, in your browser.

YAML15 lines · 265 B
JSON

Your config stays on your device.

YAML parsing uses js-yaml in your browser. JSON parsing is native. Nothing leaves the page — useful when the input is a secret file you shouldn’t be pasting into a website.

How to use it

  1. 1Pick a direction — YAML → JSON or JSON → YAML.
  2. 2Paste your input on the left. The converted output appears on the right as you type, with errors surfaced inline if the input doesn't parse.
  3. 3Pick 2-space or 4-space indentation for the output. Swap directions to round-trip and verify the conversion preserves your structure.

Common use cases

  • Convert a Kubernetes manifest from YAML (what kubectl wants) to JSON (what some APIs and validators want).
  • Translate a docker-compose.yml or GitHub Actions workflow into JSON to feed into a script.
  • Lift JSON config out of an app and rewrite it as YAML for human-friendly editing.
  • Sanity-check that a YAML file parses cleanly before committing — the error message tells you which line broke.
  • Convert a multi-document YAML file (--- separated) into a JSON array of documents.

Frequently asked questions

Is my config sent anywhere?
No. The conversion runs entirely in your browser — js-yaml on the YAML side and native JSON.parse / stringify on the JSON side. Important when the input is a secrets file or production manifest you shouldn't be pasting into a public website.
Does it handle multi-document YAML (--- separated)?
Yes. When converting YAML → JSON, multiple documents become a JSON array of documents. A single-document YAML stays as one root object.
Why does my YAML lose comments after converting?
JSON has no concept of comments, so they're dropped. Converting JSON back to YAML won't restore them. If you need to keep comments, edit in YAML directly.
What YAML version is supported?
YAML 1.2 (the standard most tools use today) via js-yaml. Anchors, tags, multi-line strings, and complex keys all work.
How big a file can it handle?
Anything your browser's memory can hold. Megabyte-sized configs parse in milliseconds; very large multi-document files (10+ MB) may pause the page briefly during conversion.