Skip to content
Back to tools

JSON ↔ YAML Converter - Convert JSON to YAML Online

Convert JSON to YAML and back. Bidirectional, in-browser, with indent control and type-safe round-trips.

JSON → YAML
JSON
Paste or type to begin.
YAML
Paste or type to begin.

Paste any JSON object or array and get clean YAML instantly — or go the other way and convert YAML back to formatted JSON. Both directions run entirely in your browser with no server involved. Choose 2- or 4-space indentation, optionally sort keys alphabetically in JSON output, and get clear error messages with line numbers when the input is malformed. Non-string YAML keys are coerced to strings with a warning so round-trips stay predictable.

How to use

  1. 1

    Pick a direction

    Use the swap button to choose JSON → YAML or YAML → JSON.

  2. 2

    Paste your input

    Drop any valid JSON or YAML into the left panel, or click Load sample to try an example.

  3. 3

    Tweak options

    Open Settings to change indentation (2 or 4 spaces) or enable key sorting for JSON output.

  4. 4

    Copy or download

    Use Copy or Download on the right panel — your data never touches a server.

FAQ

Q.Does it work in both directions?

Yes. Use the swap button to toggle between JSON → YAML and YAML → JSON at any time. The current output becomes the new input.

Q.Are data types preserved?

Yes. Strings, numbers, booleans, nulls, arrays, and objects all round-trip faithfully between JSON and YAML.

Q.What happens with non-string YAML keys?

YAML allows non-string keys (e.g. integers or booleans as keys), but JSON does not. The converter coerces them to strings and shows a warning so you know the output differs slightly from the input.

Q.Will my data be sent anywhere?

No. All parsing and serialization runs in your browser. There is no server-side processing.

Q.Is a JSON → YAML → JSON round-trip lossless?

Yes, for all JSON-compatible types. Key order may change if sort keys is enabled, but all values are preserved exactly.

Related tools