CONFIG, WITHOUT THE BRACES

JSONYAML

JSON to YAML Converter

Transform strict JSON into YAML that is easier to review, edit, and place in configuration files.

$json-to-yamlbrowser session
01
JSON input6 lines · 134 B
02
YAML outputReady when you are
# Ready when you are
100% privateBrowser-local conversionFast and lightweightNo server round-tripsFlexible outputIndent and line widthDeveloper friendlyStrict JSON input
USE CASES / 01

Where generated YAML earns its place

JSON is excellent for machines. YAML is often easier to maintain when configuration becomes a shared human artifact.

CONVERSION NOTES / 02

What changes when braces become indentation

01

JSON must be valid first

Comments, trailing commas, undefined, and JavaScript object literals are rejected instead of silently repaired.

02

Formatting is intentionally selectable

Two or four spaces and practical line-width choices cover common YAML style conventions without turning the tool into an IDE.

03

Some information cannot transfer

JSON has no comments, anchors, custom tags, or original YAML formatting, so the converter cannot invent or restore them.

TYPE MAPPING / 03

From JSON values to readable YAML

JSON has a compact, predictable type system. YAML can express the same objects, arrays, strings, numbers, booleans, and null values with less punctuation.

01
"name": "Ada"name: Ada

ResultSafe strings may be written without quotes. The serializer adds quotes when a plain scalar could be misunderstood.

02
"enabled": trueenabled: true

ResultJSON booleans remain booleans and use lowercase true or false in the YAML output.

03
"count": 42count: 42

ResultJSON numbers remain numeric. Very large values have already passed through JavaScript number parsing.

04
"items": ["a", "b"]items: - a - b

ResultArrays become YAML sequences. Their order is preserved and nested arrays receive additional indentation.

05
"value": nullvalue: null

ResultJSON null remains an explicit YAML null so it is not confused with a missing key.

06
"meta": {"id": 7}meta: id: 7

ResultObjects become YAML mappings. Property traversal normally retains insertion order, but order is not JSON semantics.

ROUND-TRIP NOTES / 04

Readable output still deserves a review

The generated YAML represents the parsed JSON value, not the exact source text. These boundaries matter when the file will be committed as configuration or passed to another parser.

Comments cannot be generated

JSON contains no comment tokens, so a converter has no reliable source for explanatory YAML comments. Add human notes after conversion when the file needs them.

Duplicate keys are already gone

A parsed JSON object cannot preserve duplicate property names as separate values. Validate the source before relying on the converted file.

Large numbers may lose precision

JSON numbers are parsed using JavaScript numeric behavior. Quote identifiers and precision-sensitive integers in the source when they are intended as text.

Round trips change formatting

Converting JSON to YAML and back should preserve supported values, but whitespace, quoting style, line wrapping, and object formatting will not be identical.

FAQ / 03

Before you generate a YAML file

Is the JSON sent to a server?+

No. JSON parsing and YAML generation run in the browser, and local files are read with the File API.

Does YAML preserve JSON data types?+

Strings, numbers, booleans, null, arrays, and objects are represented in YAML. Consumers can still apply their own YAML schemas when loading the result.

Can I choose indentation?+

Yes. The converter supports two or four spaces and selectable line wrapping.

Why did the output order stay the same?+

JavaScript object traversal normally retains JSON insertion order, and the converter does not alphabetically reorder keys.

Will the converter add YAML comments or anchors?+

No. JSON has no comments, anchors, aliases, or custom tags, so the converter cannot infer them. The output is deliberately standard, readable YAML.

Is JSON to YAML conversion reversible?+

Supported data values can usually be converted back, but formatting choices are not reversible. Quotes, whitespace, line wrapping, and comments will not reproduce the original source.