Verifiable example
This JSON contains an object, a number, a boolean, a string that looks like a number and an array:
{
"service": {
"name": "api",
"port": 8080,
"active": true,
"version": "1.0",
"tags": ["production", "private"]
}
}
The result preserves the structure and types:
service:
name: api
port: 8080
active: true
version: "1.0"
tags:
- production
- private
version remains in quotes because in the original JSON it was text, not a
number.
How it works
Paste a document and press Convert to YAML or use Ctrl/⌘ + Enter. The
tool first checks the JSON syntax, preserves the order of the
properties and generates block-style YAML with two-space indentation.
Simple strings are displayed without quotes. Those that could be confused
with numbers, booleans, null, or dates stay quoted to preserve their type.
Numbers are written from their original tokens, so large integers do not pass
through a floating-point conversion.
The guide how to convert JSON to YAML without losing types explains what to check in ambiguous strings, large numbers, collections, and the application that will read the result.
You can then copy the result or download it as a .yaml file. Processing runs
within this tab. Input is not sent over the network, saved to local storage, or
added to the URL.
Common uses
- Prepare a configuration for Docker Compose or Kubernetes.
- Pass data from an API to a file that is more convenient to review.
- Create the basis of a CI workflow that uses YAML.
- Convert JSON examples for technical documentation.
The conversion changes the representation, not the intended meaning of the values. Still, validate the result in its destination application: each system can apply additional rules to its configuration.
Common errors
- Trailing commas: JSON does not allow a comma before
}or]. - Single quotes: JSON property names and strings require double quotes.
- Comments: JSON does not support
//or/* ... */. - Manual indentation changes: YAML uses spaces for indentation. Do not mix tabs into the generated indentation when editing the result.
If the input is invalid, the tool displays the first problem and its location when available. For a fuller diagnostic, use the JSON validator.
Edge cases
- Empty objects and arrays are represented as
{}and[]. - Objects, arrays, strings, numbers, booleans and
nullas root are supported. - Unicode and escaped line breaks are preserved.
- Large integers keep all their digits.
- Duplicate property names are preserved, but YAML mappings require unique keys. Resolve duplicates in the source before using the output; the reverse YAML-to-JSON converter rejects them.
- Input is limited to 1,000,000 characters and 100 levels of nesting to protect the tab.
- JSON does not contain comments, anchors, or aliases, so the tool cannot recover them in the YAML.
Frequently asked questions
Do JSON and YAML represent exactly the same types?
Both can represent objects or mappings, lists, text, numbers, booleans, and
null. YAML also offers constructs that JSON does not have. This conversion is
limited to JSON’s data model and quotes ambiguous strings.
Can I convert a file with comments?
Not as strict JSON. Remove comments before converting. Only turn them into text properties if the receiving application accepts those fields. The tool does not interpret JSON5.
Is my configuration sent to a server?
No. Validation and serialization run locally in the browser. The input is not saved or recorded; closing or reloading the page clears it.