INI to JSON Converter — Convert Configuration Files Online

INI to JSON Converter

Paste an INI file — php.ini, my.cnf, a Git or Python configparser file, a Windows .ini — and get the same settings as JSON. Conversion runs in your browser; nothing is uploaded.

How the conversion works

  • [section] headers become objects. Every key = value after a header goes into that section's object.
  • Keys before the first section go at the top level of the JSON.
  • ; and # lines are comments and are skipped, as are blank lines.
  • The value is everything after the first =, trimmed — so url = https://example.com/?a=b keeps the full URL.
  • Values stay strings. INI has no types, so port = 5432 becomes "5432" and enabled = true becomes "true"; convert them in your code as needed. Quotes around a value are kept as part of the string.
  • Lines without = are ignored, and if a key repeats within a section the last value wins.

Example

; Application settings
name = demo
 
[database]
host = localhost
port = 5432
 
[cache]
enabled = true

becomes

{
  "name": "demo",
  "database": {
    "host": "localhost",
    "port": "5432"
  },
  "cache": {
    "enabled": "true"
  }
}

When to convert INI to JSON

  • Migrating configuration from an INI-based tool to one that reads JSON (or YAML — convert the JSON with JSON to YAML).
  • Inspecting a large config in a JSON viewer: paste the output into the JSON Formatter for a collapsible tree.
  • Comparing two config files structurally with JSON Diff, so key order and whitespace do not matter.
  • Feeding settings to a script that already parses JSON.

INI dialects

INI is not one standard. This converter handles the common core — sections, key = value pairs and comments. Dialect-specific features are passed through as plain text: PHP's key[] = value arrays become a key literally named key[] (the last value wins), and line continuations or ${var} interpolation are not expanded.