Nested customer records
- Input
- JSON: [{"id":"001","customer":{"name":"Ada","city":"München"},"tags":["priority","quoted, comma"]}]
- Output
- YAML included id: "001", customer.name: Ada, customer.city: München, and tags: '["priority","quoted, comma"]'.
JSON to YAML goes through our table engine rather than a tree-to-tree dump, so nested objects flatten into dotted YAML keys before output is written.
From real runs
| Element | Result | What happens |
|---|---|---|
| Top-level array | Kept | The two JSON objects became two YAML sequence items in the same order. |
| Nested objects | Changed | customer.name, customer.city, and extra.gift were written as dotted top-level keys instead of nested mappings. |
| Arrays | Changed | The tags array became YAML scalar text such as '["priority","quoted, comma"]' rather than a YAML list. |
| Null values | Kept | The JSON null empty field stayed null in the YAML output for both records. |
| Unicode text | Kept | München, Zoë, and 東京 survived the JSON parse and YAML write as readable UTF-8 text. |
| String identifiers | Kept | The JSON strings 001 and 02134 were quoted in YAML and did not lose their leading zeroes. |
The two JSON objects became two YAML sequence items in the same order.
customer.name, customer.city, and extra.gift were written as dotted top-level keys instead of nested mappings.
The tags array became YAML scalar text such as '["priority","quoted, comma"]' rather than a YAML list.
The JSON null empty field stayed null in the YAML output for both records.
München, Zoë, and 東京 survived the JSON parse and YAML write as readable UTF-8 text.
The JSON strings 001 and 02134 were quoted in YAML and did not lose their leading zeroes.
We converted our JSON sample (557 B) with Table engine on 2026-09-11. It took 1 ms and produced a 391 B YAML file, 30% smaller than the input. The engine raised no warnings.
Input · sample.json · 557 B
Array of 4 objects; keys: company, stage, arr, owner, close_date
Output · sample.yaml · 391 B
4 list items, 0 top-level keys, 20 lines
First lines of the output
- company: Northwind Traders
stage: Proposal
arr: 48000
owner: R. Ayers
close_date: 2026-10-14
- company: Contoso Ltd
stage: Negotiation
arr: 120000
owner: P. Ng
close_date: 2026-09-30
- company: Fabrikam
stage: Qualified
arr: 22500
owner: R. Ayers
close_date: 2026-11-02
- company: Tailspin Toys
stage: Won
arr: 64000
…Python json and PyYAML
python - <<'PY'
import json, yaml
with open("input.json", encoding="utf-8") as f:
data = json.load(f)
with open("output.yaml", "w", encoding="utf-8") as out:
yaml.safe_dump(data, out, allow_unicode=True, sort_keys=False)
PYThis keeps the original JSON tree, unlike tabular-ir's flattened row model.
The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=json&to=yaml.
curl -X POST https://filetypeconverters.com/api/v1/convert \
-H "Authorization: Bearer $FTC_API_KEY" \
-F "file=@input.json" -F "from=json" -F "to=yaml" \
-F 'options={"encoding":"utf-8"}' \
--output output.yaml| Key | Applies to | Type | Default |
|---|---|---|---|
| encoding | Reading JSON | utf-8 · latin1 | utf-8 |
| flattenSeparator | Reading JSON | string | . |
| arrayMode | Reading JSON | json · explode | json |
| delimiter | Writing YAML | string | , |
| newline | Writing YAML | · | |
| sheetName | Writing YAML | string | |
| dialect | Writing YAML | postgres · mysql · sqlite | postgres |
| tableName | Writing YAML | string | data |
| createTable | Writing YAML | boolean | true |
No. In the tabular path, nested objects flatten into keys such as customer.name. Use a direct JSON-to-YAML dumper when the hierarchy itself is the deliverable.
With the default array handling, arrays become JSON text inside a YAML scalar. Our tags field was written as a quoted string containing the array.
Yes in the run we inspected. Values already typed as JSON strings, such as 001 and 02134, stayed quoted strings in YAML.