Per platform
| iPhone and iPad | High fidelity | |
|---|---|---|
| Android | High fidelity |
How it works
- Import the JSON file, or share it with Tramuta.
- Pick YAML among the formats.
- Tap “Convert”, then “Share” or “Save to…”.
YAML is the format of many configuration files because it is easier to read and edit by hand than JSON: no curly braces, no trailing commas, indentation instead of closing brackets. Tramuta converts JSON to YAML on the phone or tablet, handy for tidying up a configuration on the go without pasting it into a website.
What the JSON looks like as YAML
The structure stays the same: objects, lists, strings, numbers, booleans and null, with keys in the order of the source file. Tramuta writes block-style YAML with two-space indentation. An object with fields of different types comes out like this:
- id: 1
nome: Caffè, macinato
prezzo: 4.5
data: "2024-01-15"
attivo: true
note: ""
tag:
- a
- b
extra: null
Look at data and note: the date is a string in the JSON and gets quotes, or YAML would read it as a date; the empty string gets them so it doesn’t vanish. That’s why the conversion is “High fidelity”: the value you read back from the YAML is the same as the JSON. Empty objects and lists become {} and [].
JSON to YAML on iPhone, iPad and Android
Reading the JSON and writing the YAML is the app’s own Dart code, the same on both platforms. The file is written as UTF-8 without a BOM, with LF line endings and a final newline.
The options for this pair
There are none: from JSON to YAML the “Options” sheet stays empty. Separator, header row and number recognition are for reading or writing CSV and TSV tables, while here the structure is copied as it is, from one tree format to the other. JSON types are left alone: a number stays a number, a string stays a string.
How to do it in Tramuta
- Tap “Choose or drop files” and pick the
.jsonfile, or open it in Tramuta with “Open in…”. - Under “Convert to”, pick “YAML”.
- Tap “Convert”.
- Use “Save to…” to put it in the right folder, or “Share”.
If you need a table out of the JSON, there is JSON to CSV. The source JSON itself can come from an XML file with XML to JSON or from a list with CSV to JSON.
Questions
Why do some strings get quotes and others don’t?
Double quotes are added only where YAML would otherwise read another type or a structure: text that looks like a number, a date, a boolean or null (such as “2024-01-15”, “4.5”, “yes”), empty strings, text containing “: ” or “#”, or starting with a special character. That way every string is still a string when the file is read back.
If I read the YAML back, do I get the same JSON?
Yes, as a value: the app’s tests convert a JSON file to YAML and back to JSON and check that the content is identical. Only the text layout, such as whitespace, may differ.
What happens if the JSON is invalid?
The conversion stops and the error gives the line and column where the JSON can’t be read. No half-written file is left behind.
Can I add comments to the YAML I get?
Yes, afterwards, in a text editor: YAML allows them. The source JSON has none, so the freshly converted file doesn’t contain any.
Free on iPhone, iPad and Android
No ads, no in-app purchases, no account.
-
App Store
iPhone and iPad, iOS 15.0 or later.
Coming to the App Store -
Google Play
Android 7.0 or later.
Coming to Google Play -
APK for Android
Android 7.0 or later, without Google Play.
The APK is not available yet.