INI ⇄ JSON Converter

Client-sideNo sign-upFree

Convert INI config files to JSON or JSON to INI, in either direction, in your browser.

Quick facts

Category
Converters
Best for
Reading a legacy .ini config file as JSON for scripting
INI
JSON
{ "env": "production", "debug": false, "database": { "host": "localhost", "port": 5432, "name": "formatiq" }, "cache": { "ttl": 300, "enabled": true } }
✓ Converted
Sections become nested JSON objects, and "true"/"false"/numeric values are inferred to their JSON types rather than kept as strings. INI has no native array syntax, so arrays in JSON input can't convert back to INI. Working with YAML config instead? Try the JSON ⇄ YAML Converter. Working with a Java .properties file? See the Properties ⇄ JSON Converter. Need TOML instead? Try the TOML ⇄ JSON Converter.
In-content slot
Was this tool helpful?
On this page

Overview

Convert an INI-format config file into JSON, or JSON into INI, with sections in square brackets mapping to nested JSON objects and top-level key=value pairs mapping to top-level JSON keys. Comments starting with ";" or "#" are recognized and skipped during INI → JSON, and "true"/"false"/numeric values are inferred to their JSON types rather than kept as plain strings, matching how most INI parsers behave in practice. INI has no native array or nested-section syntax, so JSON input with arrays or sections nested more than one level deep can’t convert back to INI - the tool flags this explicitly rather than silently producing invalid output. Useful for reading a legacy .ini config (PHP, Windows, older desktop apps) as JSON for scripting, or generating an .ini file from a JSON config object. Runs entirely client-side.

Best for: Reading a legacy .ini config file as JSON for scripting

How to use this tool

  1. Pick a direction. Switch between INI → JSON and JSON → INI with one click.
  2. Paste your input. Drop in an INI file or a JSON config object.
  3. Read the converted output. Sections become nested objects, comments are skipped, and types are inferred automatically.
  4. Swap and repeat. Use the swap button to feed the output straight back in as new input.

Why use this tool

Handles sections and comments

Recognizes [section] headers and ";"/"#" comment lines the way real INI parsers do.

Type inference

"true", "false", and numeric-looking values become their proper JSON types, not just strings.

Honest about INI’s limits

Flags JSON arrays or deeply nested objects explicitly rather than silently producing broken INI.

Nothing leaves your browser

Conversion happens entirely client-side - useful when the config contains real connection strings or credentials.

Frequently asked questions

INI has no native syntax for arrays or for sections nested more than one level deep. If your JSON has an array value or an object nested inside another nested object, flatten it first - the error message names the specific key that caused the problem.

No - comments in the original INI are discarded during INI → JSON, since JSON has no comment syntax to hold them, so converting JSON back to INI won’t restore any comments that were in the original file.

Any line matching "[name]" starts a new section, and every key=value line after it belongs to that section until the next "[name]" line or the end of the file. Key=value lines before the first section header become top-level JSON keys rather than nested ones.

Explore more free tools

Formatters, converters, validators, and generators - all free and running entirely in your browser.

Browse more tools