JSON tools

JSON to YAMLkeep the types your configuration needs

Inspect the sample or paste strict JSON. Adjust indentation and multiline style before exporting validated YAML.

JSON to YAML

YAML to JSON

JSON input

Processed in this browser. Your input is not uploaded or stored.

YAML result

Output options

Type preview

Result is out of date; export is disabled.

Use JSON to YAML when an API response must become a readable configuration. A port number and a quoted port label may look alike, yet the receiving program treats them differently.

This converter keeps the distinction visible with typed paths. It also retains numeric spelling, including long identifiers and decimal zeros, instead of letting JavaScript round the values first.

Why use JSON to YAML here?

See types before they become bugs

JSON to YAML keeps strings quoted, so "true", "007" and date-shaped text remain strings. The path preview distinguishes them from booleans and numbers; the six counters include every node, even those beyond the preview limit.

Matching colored data types on the JSON input and YAML output, with a type inspection panel.

Choose how line breaks appear

A literal block displays separate lines as configuration text. Quoted mode uses escape sequences instead. Neither choice is meant to fold or remove line breaks; the converter reparses its output to compare the actual string values.

A single escaped string becomes a multiline block with the same three lines.

Check the details before exporting

01

Compare values with their types

The empty JSON Pointer means the document root. A slash in a key becomes ~1 and a tilde becomes ~0. Preview entries include containers, not just leaves; show more adds 50 entries up to the first 500.

02

Switch execution deliberately

Automatic conversion waits 350 milliseconds after editing. Turn it off to use Convert or Ctrl/Cmd+Enter. Changing input or either option immediately disables export until the current result passes validation.

03

Check the target reader too

The status confirms a YAML 1.2 data check. Your target program may still round large numbers or reject application fields. Test the downloaded file with the program that will consume it.

A configuration with its structure intact

One document, any JSON root

Objects become mappings and arrays become sequences. A top-level string, number, boolean or null is also accepted. Empty maps and lists stay distinct as {} and [], rather than disappearing from the result.

Original numeric tokens

Long integers, exponent spelling, negative zero and decimal zeros are emitted from the JSON token. No intermediate Number conversion is used for generation; numeric tokens are also compared during the post-conversion check.

Readable strings without inference

Ordinary values and keys use double quotes. Literal mode uses | with a suitable trailing-newline marker when possible; carriage returns and control characters may require quoted escapes. Two or four spaces set nesting indentation.

Reparse before export

The YAML parser checks the generated syntax, then mappings, sequence order, types and string values are compared with the JSON tree. A mismatch prevents copying and downloading. JSON to YML is the same format conversion; the download uses .yaml.

What conversion does not establish

Strict JSON only
Comments, trailing commas, JSON5 and duplicate keys are rejected with input line and column information. There is no automatic repair. Fix the original data so that a conversion cannot silently discard an earlier key.
Single direction and document
This page does not accept YAML input or split arrays into multiple documents. Reverse conversion belongs to its own tool. It generates no anchors, aliases, custom tags or comments, and has no file, URL or batch import.
Bounded work
Input is limited to 500,000 characters, 50,000 nodes and depth 100. Output is limited to 2,000,000 characters. Over-limit input stops conversion. The path table keeps only 500 entries, while the complete accepted document is exported.
Syntax is not an application schema
The check does not validate Kubernetes, Docker Compose or OpenAPI fields. YAML 1.2 output is not a guarantee that a legacy YAML 1.1 loader or a particular application will interpret every numeric value as intended.
Values, not original formatting
Key order is retained, including numeric-looking keys. Whitespace and escape spelling are rebuilt. No keys are sorted, no nulls removed and no comments restored. Target readers remain responsible for their own numeric precision.

JSON to YAML questions

How do JSON types map to YAML?

Mappings, sequences, strings, numbers, booleans and null retain their corresponding data types. The preview labels each path, including the root and empty containers. A quoted "8080" stays a string; 8080 stays a number.

Is the converted YAML valid?

The generated document must parse successfully as YAML 1.2 and match the original structure and values before export is enabled. This verifies format conversion, not the validity of an application configuration.

How does the converter decide when to quote a string?

This JSON to YAML converter quotes ordinary strings and keys consistently. Multiline values may use literal blocks. Quoting prevents text such as "true" or a date from being inferred as a different type.

Does the converter preserve key order?

Yes. The parser stores object entries in input order, including keys such as "9" followed by "2". Arrays also retain order. There is no sorting option, so the layout follows the source hierarchy.

Can it handle very deep nesting?

Nesting is supported to depth 100 under the character and node budgets. Deeper input is rejected instead of producing a partial document. Reduce the structure or process a smaller configuration.

Found an edge case this converter gets wrong?

Prepare a readable configuration

Use JSON to YAML to compare the example’s string and numeric port values, choose a multiline style, then download the checked configuration.