Which configuration format should I choose: JSON, YAML, TOML, XML, or INI?

Use whatever your app expects. When you get to choose, the real difference is how each format groups your settings and whether it lets you leave notes. Converting between them can quietly drop those notes.

Five layouts for the same notes

A configuration file is a set of written choices a program reads, such as which server to contact. Think of JSON, YAML, TOML, XML, and INI as different layouts for the same notes. The program needs to understand the layout before it can use the choices.

Imagine settings with a server group for the address and a checks group listing paths to check. Follow the group boundaries, the list and the human note in each layout.

Illustrative settings use host api.example and check paths /status and /events. JSON uses braces and has no comments; YAML uses indentation and dashes; TOML uses headings and an array; XML uses enclosing and repeated tags. INI uses section headings, with the paths list left out because there is no standard INI list notation.

Groups, a list and a note across five formats

Groups, lists and comments use different marks. How we reviewed

Which format fits your settings?

If you get to choose, start with the way you'll edit the settings: follow indentation, scan named groups, or work with tags. You don't need to convert a working file just for its looks.

Use the format the app requires. When several work: JSON for data programs exchange, with braces and no comments; YAML for nested settings, with indentation and dash lists; TOML for named groups, with headings and arrays; XML for document-shaped data, with enclosing and repeated tags; INI for simple sectioned settings, following the app's rules for lists.

Choose by the layout and notes you'll work with

INI has no single shared rulebook for lists; repeating a key is rejected by FluffyBench's INI parser.

What can change when you convert settings?

A conversion rewrites settings in the new format's terms. A human note becomes a comment in YAML; converting to JSON removes that note.

Illustrative YAML contains a Morning meeting server comment and a host setting. JSON keeps the host setting without the comment.

The setting stays; the human note is absent

Converting to JSON keeps the address, not the comment.

Even a word can change meaning. Unquoted yes can mean true under YAML 1.1; YAML 1.2 reads it as text. Quotes make your intended word explicit.

Specification examples: answer: yes becomes a boolean under YAML 1.1 and text under YAML 1.2. Writing answer: "yes" expresses text.

The YAML rules affect how an unquoted word is read

Match the receiving app's YAML rules; FluffyBench reads YAML 1.2.

Doing it in FluffyBench

FluffyBench's JSON formatter can tidy YAML or turn it into JSON on your device. The Do choice decides which job you're doing.

  1. FluffyBench's Language selector set to YAML and Do selector set to Format.
    FluffyBench's Language selector set to YAML and Do selector set to Format.
    Step 1. Choose YAML to tidy a YAML file without changing its format.
    1. Choose YAML under Language.
    2. Leave Do on Format.
  2. YAML input with a host setting and a comment; the Result tab is above the editor.
    YAML input with a host setting and a comment; the Result tab is above the editor.
    Step 2. Keep your original; paste a copy into Input. Short drafts update as you type.
    1. Paste your settings here.
    2. Open Result to inspect the formatted YAML.
  3. Formatted YAML retains the Morning meeting server comment and the host setting.
    Formatted YAML retains the Morning meeting server comment and the host setting.
    Step 3. Format keeps YAML comments; the first line is still there.
    1. Check that the comment and host are present.
  4. FluffyBench's YAML Language and Convert to JSON action.
    FluffyBench's YAML Language and Convert to JSON action.
    Step 4. For a JSON destination, change Do to Convert to JSON; paste the YAML into Input again if needed.
    1. Choose Convert to JSON.
  5. Complete JSON result with the host setting, Copy and Download controls, and the notice YAML comments, anchors and styles are dropped.
    Complete JSON result with the host setting, Copy and Download controls, and the notice YAML comments, anchors and styles are dropped.
    Step 5. Open Result, check the JSON and the loss notice, then Copy the text or Download config-result.json.
    1. Read what the conversion dropped.
    2. Copy the text or Download the JSON file.

Check that your app reads the converted settings as you intended.

Use FluffyBench's JSON formatter to tidy settings or convert them to JSON.

Search FluffyBench