PRPickrack

YAML ↔ JSON Converter

Convert YAML to JSON or JSON to YAML. Browser-side, instant, with inline error reporting.

Indent

Convert YAML to JSON or JSON to YAML with adjustable indent. Inline error reporting, browser-side.

YAML ↔ JSON Converter parses YAML into a JS object and serializes it as JSON (or vice versa). Use it when you're translating Kubernetes manifests, GitHub Actions workflows, Docker Compose files, or any config that arrives in the 'wrong' format for your tooling. Two-way, instant, browser-side.

Pickrack uses js-yaml (the de-facto YAML 1.2 implementation, 6k+ stars). It handles anchors and aliases, multi-document YAML (--- separators), block + flow styles, and YAML's full type set (strings, numbers, booleans, null, lists, maps, dates). JSON serialization uses the browser's native JSON.stringify with adjustable indent.

Free, no signup. Your config files never leave your tab — important for YAML that contains secrets, internal service URLs, or other data you don't want in some random conversion service's logs. Parse errors show line + column so you can fix them in place.

Key features

  • BidirectionalYAML → JSON or JSON → YAML. Swap button moves the output back to input + flips direction — useful for round-tripping.
  • Inline error reportingYAML parse errors show line + reason. JSON parse errors show position. Both display next to the input rather than as alerts.
  • Adjustable indent2 or 4 spaces for both YAML and JSON output. Matches your project's style guide.
  • Anchor + alias supportYAML anchors (&anchor) and aliases (*anchor) are resolved during YAML → JSON conversion (JSON has no anchor concept, so the values get inlined).
  • Browser-side parsingConfigs never leave your tab. Safe for YAML/JSON containing real secrets, internal hostnames, or other sensitive data.
  • Load sample buttonPre-loaded Pickrack config example showing nested maps, lists, and mixed types.

How to use

  1. Step 1: Pick directionYAML → JSON or JSON → YAML.
  2. Step 2: Paste your inputOr click 'Load sample' to see a realistic config.
  3. Step 3: Pick indent2 spaces (default — matches most modern style guides) or 4 spaces (legacy projects).
  4. Step 4: Copy the outputClick Copy. Paste into your editor or pipe into your CLI.

When to use

  • Convert a Kubernetes manifest between YAML (what you write) and JSON (what kubectl serializes internally)
  • Translate a GitHub Actions workflow from YAML (the spec) to JSON to manipulate programmatically
  • Convert package.json metadata to YAML for a pnpm workspace pnpm-workspace.yaml file
  • Reformat a Docker Compose v2 YAML file to JSON for comparison or transformation
  • Read a verbose JSON config in YAML form — YAML is easier to scan with deep nesting
  • Convert an Ansible playbook between formats during development

Frequently asked questions

Does it support YAML 1.2?

Yes — js-yaml is YAML 1.2-compliant by default. That includes the strict boolean parsing (only true/false are booleans; yes/no/on/off are strings, unlike YAML 1.1).

What happens to YAML anchors when converted to JSON?

Anchors and aliases get inlined — JSON has no anchor concept, so each *alias reference becomes a copy of the anchored value. This may bloat the JSON if you had many references to the same large block.

What about JSON → YAML reverse — does it create anchors?

No — Pickrack's JSON → YAML output doesn't auto-detect repeated structures to create anchors. You get straight YAML serialization. Anchor creation is on the roadmap.

Does it handle multi-document YAML (`---` separators)?

v1 parses only the first document. Multi-doc support is on the roadmap. For now, split your YAML by --- and convert each document separately.

Why does my number become a string in JSON?

If your YAML had quotes around it ('42' vs 42), YAML treats it as a string. JSON preserves that string type. Remove the quotes in YAML if you want it as a number.

Are comments preserved?

No — both directions lose comments. YAML supports # comment, JSON has no comment syntax. JS-YAML doesn't expose comments via its parser. This is a fundamental limitation of converting between the two formats.

What about TOML or XML?

Not in this tool. TOML and XML need different parsers (@iarna/toml and fast-xml-parser). They may get their own dedicated converter tools — let us know if you'd use them.

Related tools