Data Format Converter

Pick a data format for each box and convert between any two of JSON, YAML, TOML, INI, .env, properties, CSV, and XML, such as application.properties to YAML, .env to JSON, or CSV to XML. Anything lost along the way is flagged one by one, all in your browser.

Indent

How to Use

  1. Each box has a data format menu: JSON, YAML, TOML, INI, .env, properties, CSV, or XML, with YAML and TOML selected by default. Paste into either box and the other updates immediately, with no direction to pick. Both boxes can use the same format, which just re-lays out the text (sorting, indentation).
  2. A format's converter is loaded the first time you select it, with a “Loading the converter” message in the meantime, and the conversion runs automatically once it's ready. Formats you don't select are never downloaded. Your chosen formats and other settings are remembered in your browser, while pasted text and files are never saved.
  3. When you paste, the tool suggests a source format from the content. If you paste the contents of a pyproject.toml into a box set to YAML, it says “This looks like TOML” and waits for you to press the button, so it never switches on its own. JSON is also valid YAML, and when the two overlap the suggestion is JSON. For CSV it also suggests a delimiter (comma, tab, or semicolon). INI, .env, and properties look a lot like simple TOML and YAML, so a box set to one of those three never suggests switching to TOML or YAML.
  4. Click “Choose a file” or drop a file (up to 5 MB) into a box, and that box switches to the format its extension names: .json, .jsonc, and .json5 are JSON, .yaml and .yml are YAML, .toml is TOML, .ini, .cfg, and .conf are INI, .env and names starting with .env. such as .env.local are .env, .properties is properties, .csv and .tsv are CSV (.tsv also sets the delimiter to Tab), and .xml is XML. An unrecognized extension keeps the format you already chose. Non-UTF-8 files fall back to Windows-1252 on English pages, and you can switch the encoding manually. Each box's “Download” button keeps the original base name with the matching extension, and CSV gets a BOM by default so Excel shows non-English text correctly, which you can turn off in the settings.
  5. “Swap” exchanges the contents and the data formats of the two boxes together, then converts again from the box you were typing in.
  6. Not every pair can carry everything, so the tool converts anyway and warns one by one with the affected path: comments aren't kept; TOML has no null, so nulls are omitted; TOML dates and times become strings; YAML anchors and aliases are expanded and only the first of several documents is converted; CSV, INI, .env, and properties have no nesting, so nested data is flattened into key names, while XML maps it to attributes and #text; null becomes an empty cell, element, or value, and INI omits it. Integers and decimals beyond the exact range keep their original digits, except that integers TOML can't hold (beyond 64 bits) become strings with a warning.
  7. An error appears only when the root structure can't fit the target at all: a TOML, INI, .env, or properties root must be an object; a CSV root must be an array of objects (or an array of arrays without a header row); an XML root is a single root element, so XML can't convert directly to CSV, and CSV to XML wraps each row in an item element inside a root element.
  8. CSV, XML, INI, .env, and properties values are plain text to begin with, so by default numbers and booleans are detected: plain numbers and lowercase true and false become real types, while numbers that start with 0, like 007, and integers beyond the exact range stay strings. Turn off the checkbox to keep every value a string. The delimiter, header row, and BOM settings appear only when CSV is selected, and the rebuild-nesting setting appears only when CSV or properties is selected. Indentation can be 2 spaces, 4 spaces, Tab, or minified and applies to JSON and XML output, while YAML can't use tabs or a one-line style and uses 2 spaces for those. “Sort keys” orders every object's keys and leaves arrays alone.
  9. INI, .env, and properties are parsed and written by code written for this tool, with these rules. INI: sections become top-level objects, keys before the first section stay at the top level, whole lines starting with ; or # are comments (dropped, with a warning), matching quotes around a value are removed, a ; or # at the end of a line belongs to the value, and a repeated key in a section keeps its last value with a warning; on output, nesting below a section is flattened into dotted key names like server.port and arrays into index names like tags.0, each with a path warning, and null is omitted. .env: export prefixes, single quotes (no escapes), double quotes (\n, \t, \", and \\ escapes, and they may span lines), and # comments are supported, and the result is one flat object; on output nesting is joined with __ (such as db__host) with a warning, values containing spaces, quotes, backslashes, or # get double quotes, and null becomes an empty value. properties: =, :, and whitespace separators, # and ! comments, line continuation with a trailing backslash, and \uXXXX escapes are supported; dotted keys are rebuilt into nesting by default and a.0, a.1 become an array, a name that is both a value and a parent keeps those keys flat with a warning, and you can turn the rebuilding off in the settings; on output nesting is flattened into dotted keys and non-ASCII text is written as plain UTF-8, not as \uXXXX.
  10. For a fixed JSON pairing you can also use the dedicated pages: JSON to YAML, JSON to TOML, JSON to CSV, and JSON to XML, each with a fuller explanation of its mapping rules.
  11. Syntax errors show the line and column, quote the source line with a ^ marker, and keep the other box's last valid output.

FAQ

Which formats can the data format converter handle?

JSON, YAML, TOML, INI, .env, Java properties, CSV, and XML. Each box takes any of them and every pair converts, including pairs that don't involve JSON, such as YAML to TOML, properties to YAML, .env to JSON, and INI to TOML. The same format in both boxes just re-lays out the text.

Why do XML to CSV and CSV to TOML fail?

The structure can't fit the target format, which is different from the converter being broken. Each CSV row is one record, so the source root must be an array of objects. An XML root is a single element rather than an array, and a TOML root must be an object, not an array, so XML to CSV and CSV to TOML can't convert directly. Go through JSON or YAML instead: for example turn the CSV into YAML and wrap it in an object yourself before putting it in TOML, or pull the repeated XML elements out as an array.

What gets lost in a conversion, and how does the tool tell me?

Comments aren't kept; TOML has no null, so nulls are omitted; TOML dates and times become strings; YAML anchors and aliases are expanded and only the first of several documents is converted; XML processing instructions and the order of mixed content are lost; CSV has no nesting, so nested data is flattened into column names like address.city. Each case gets its own warning with the path under the result box, so you can judge whether the result is usable as is.

Why didn't the format switch automatically after I pasted?

The tool only suggests a format from the content and never switches on its own, because some content is ambiguous: JSON is valid YAML, for example, and a wrong automatic guess gives confusing output. If you agree with the suggestion, press the button to switch; otherwise ignore it. Opening a file does switch by extension, and an unrecognized extension keeps the format you chose.

How are numbers, booleans, and numbers starting with 0 handled?

From JSON, YAML, or TOML, the original types are kept and numbers beyond 2 to the 53rd power are written with their original digits. From CSV, XML, INI, .env, or properties, values start as plain text, so by default plain numbers and lowercase true and false become numbers and booleans, while postal codes and phone numbers like 007 and long integers beyond the exact range stay strings. To keep everything as strings, turn off “Detect numbers and booleans”. YAML is read under the 1.2 rules, so no, on, and yes are strings, not booleans.

Can application.properties be converted to application.yml?

Yes. Choose properties for the top box and YAML for the bottom one, then paste or open application.properties. Dotted keys like server.port=8080 are rebuilt into nested YAML, and index keys like a.0 and a.1 become a list. A name that is both a value and a parent (for example a=1 together with a.b=2) can't be rebuilt, so those keys stay flat with a warning. \uXXXX escapes and backslash line continuations are parsed correctly, so non-English text doesn't turn into garbage.

What should I know when converting .env to JSON or YAML?

export prefixes, single quotes, double quotes, and # comments are all read. Single-quoted content has no escapes, while \n inside double quotes becomes a line break. By default values like 8080 and true become a number and a boolean; to keep everything as strings, turn off “Detect numbers and booleans”. A .env file has only one level, so nested JSON is joined with __ (such as db__host) with a warning when written to .env, and it is not rebuilt into nesting when you convert back.

What happens to INI with three or more levels of nesting?

INI has only two levels, sections and keys. Top-level objects become sections, deeper nesting below a section is flattened into dotted keys like server.port and arrays into tags.0, null is omitted, and each case gets a warning with its path. Converting INI back to JSON keeps the dotted keys as they are and does not rebuild nesting.