Prepare a configuration excerpt
Turn a JSON object into consistently indented YAML. Ambiguous strings such as "true" and "01" remain distinct from booleans and numbers.
Switch quickly between JSON and YAML structures and get formatted output ready to copy or reuse in your project.
Convert JSON structures to YAML for readable configuration, or YAML to JSON for an API or your JSON tools. The converter retains nested objects, lists, booleans, strings, representable numbers and null values. It parses the source structure before serializing the target rather than replacing separators. Everything runs in your browser; no remote conversion service receives your configuration. Choose the direction explicitly whenever the source text could belong to either format.
Automatic mode reads input starting with { or [ as JSON and other input as YAML. This shortcut cannot determine every intention: JSON overlaps with many YAML forms. Select JSON to YAML for a standalone JSON scalar, or YAML to JSON for a YAML flow mapping in braces.
YAML conversion uses version 1.2 with the core schema. Objects and lists are rebuilt recursively. Mapping keys must be strings, just like JSON property names. Duplicate keys, multiple documents, custom tags, nonfinite numbers and cyclic aliases are rejected rather than discarded or flattened. Ordinary aliases expand under a bounded expansion limit; structures deeper than 128 levels are also rejected.
Integers outside JavaScript’s safe range cause a conversion error. This prevents exporting identifiers that were silently rounded. Put those identifiers in quotes in the source. Decimal values remain subject to the browser’s numeric representation; this is not an arbitrary-precision decimal converter.
YAML comments, anchor names and quotation choices have no direct JSON equivalent and are not retained through conversion. Use YAML Formatter when you want to reindent YAML while retaining documentary presentation. A round trip concerns compatible values, not original bytes or layout.
Use an explicit mode to resolve detection ambiguity. YAML to JSON can read a compact YAML mapping starting with an opening brace.
Import or paste a single structure and convert it. Fix syntax errors, duplicate keys or unrepresentable values when conversion is rejected.
Inspect strings resembling numbers and nested lists. Downloads use the resulting format’s extension and media type. Editing the source or direction hides the previous result.
Turn a JSON object into consistently indented YAML. Ambiguous strings such as "true" and "01" remain distinct from booleans and numbers.
Produce objects and arrays for JSON formatting or supported JSON Schema checks. Conversion does not verify Kubernetes, application or API-specific rules.
A non-string key or cyclic alias exposes a real difference between the models. Adapt that data explicitly instead of relying on silent deletion.
active stays boolean. Quotation marks keep number and yes as strings; the list contains an object followed by null, while the empty object remains representable.
Input
{"active":true,"number":"01","yes":"true","rows":[{"id":1},null],"empty":{}}Result
active: true
number: "01"
yes: "true"
rows:
- id: 1
- null
empty: {}
user becomes an object and tags an array. code keeps "01" as a string without becoming a number or losing its leading zero.
Input
user:
name: Ada
active: true
tags:
- api
- test
code: "01"Result
{
"user": {
"name": "Ada",
"active": true
},
"tags": [
"api",
"test"
],
"code": "01"
}Input beginning with { or [ might also be YAML, and scalar values can belong to both formats. Explicit mode states your intention without modifying the document to work around detection.
Comments have no JSON representation. Compatible aliases expand to values; their names and shared identity are lost. YAML Formatter is better suited to retaining an annotated YAML document.
JSON requires string keys and cannot represent infinite values. The converter also rejects unsafe integers instead of exporting a silent approximation. Use strings when that matches your data contract.
It checks syntax and whether values can be represented in the target format. It does not certify an application schema, deployment configuration or the suitability of chosen settings.
Related tools
Tools similar or complementary to this one.
Format and validate a YAML document to improve readability and detect common errors.
Format, minify, and validate JSON to make it easier to read or more compact.
Validate a JSON document against a schema and locate every error precisely.
Understand ISO 8601 week numbers, Unix timestamps in seconds or milliseconds, and the difference between human-readable dates and technical time values.