Skip to content

Ini Json Converter API

POST https://api.findutils.com/api/tools/ini-json-converter/execute

Convert classic INI, .cfg or .conf text to JSON, or a JSON object back to INI. Each [section] becomes a nested object and keys above the first header sit on the root. Comments opened by ; or # are dropped, quoted values keep their spaces and punctuation, and a duplicate key keeps the last value and is reported. Values stay strings unless infer_types is on. JSON to INI takes one level of sections and rejects deeper nesting or arrays rather than guessing a syntax. Not a TOML, .properties or systemd unit parser.

Request body

application/json
  • input

    string required

    The INI/.cfg/.conf text or the JSON object to convert.

  • mode

    string optional

    Conversion direction. Default: ini-to-json. One of ini-to-json · json-to-ini. Default "ini-to-json".

  • infer_types

    boolean optional

    ini-to-json: turn integers, decimals, true and false into JSON types. Default: false (every value is a string). Default false.

  • indent

    integer optional

    ini-to-json: JSON indentation width (0-8). Default: 2. Default 2.

  • delimiter

    string optional

    json-to-ini: how each line separates key and value. Default: " = ". One of = · = · : . Default " = ".

Example arguments

Verified
{
  "input": "[server]\nhost = localhost\nport = 8080"
}