JSON to INI Converter

Convert between JSON and INI format. Transform JSON objects into INI configuration files with sections and key-value pairs.

What is JSON to INI Converter?

INI is one of the oldest and simplest configuration file formats, dating back to the MS-DOS era. It organizes settings into named sections enclosed in square brackets, with each section containing key=value pairs on separate lines. Despite its age, INI remains the default config format for Python's configparser, PHP's parse_ini_file, Git's .gitconfig, and countless desktop applications on Windows and Linux. JSON, by contrast, is a hierarchical data-interchange format that uses nested braces and arrays. Converting JSON to INI flattens that hierarchy into a flat section-based layout where each top-level key becomes a section header. This tool also supports the reverse direction — parsing an INI file back into a JSON object — making it useful for migrating legacy configs into modern JSON-based systems.

How to Use

  1. Toggle the conversion direction using the arrow button: JSON to INI or INI to JSON
  2. Paste your structured JSON object or INI text into the left panel
  3. Click Convert to produce the translated output on the right
  4. Review the result — nested JSON objects are flattened with dot notation in INI mode
  5. Copy the output directly into your project's config directory

Why Use This Tool?

Migrate legacy INI configuration files into JSON-based systems without manual rewriting
Generate INI files from JSON for Python, PHP, Git, and Windows desktop applications
Round-trip conversion preserves sections, key-value pairs, and basic type information
Dot-notation flattening keeps deeply nested settings readable in INI format
No server processing — your configuration data stays entirely in the browser

Tips & Best Practices

  • Top-level JSON keys become INI sections: {"database": {"host": "localhost"}} produces [database] followed by host=localhost
  • Deeply nested objects use dot notation: {"server": {"ssl": {"cert": "path"}}} becomes [server] with ssl.cert=path
  • INI comments starting with # or ; are silently ignored when converting back to JSON
  • Array values use indexed keys: {"ports": [80, 443]} becomes ports.0=80 and ports.1=443
  • Keep your JSON flat (two levels deep) for the cleanest INI output — deeply nested structures become harder to read

Frequently Asked Questions

How are JSON types mapped to INI values?

INI has no formal type system — everything is a string. When converting JSON to INI, all values are serialized as plain text (numbers and booleans become their string representation). When converting INI back to JSON, the tool attempts to restore types: values matching 'true' or 'false' become booleans, numeric strings become numbers, and 'null' becomes null. Quoted strings have their surrounding quotes stripped.

When should I NOT use INI format?

Avoid INI when your data has deeply nested structures (more than two levels), contains arrays of complex objects, or requires explicit type preservation. INI cannot distinguish between the string '42' and the number 42 on disk, and deeply nested dot-notation keys become hard to maintain. Use JSON, YAML, or TOML instead for complex configurations.

How do sections work in the INI output?

Each top-level key in the JSON object becomes an INI section header in square brackets (e.g., [database]). Nested keys under that object become key=value pairs within that section. For example, {"database": {"host": "localhost", "port": 5432}} produces [database]\nhost=localhost\nport=5432.

How are arrays handled in the conversion?

Arrays use index notation with dot separators. For example, {"server": {"ports": [80, 443]}} becomes [server]\nports.0=80\nports.1=443. If array items are objects, they are further flattened with the index as part of the key prefix.

Can I convert INI back to JSON?

Yes. Use the direction toggle to switch to 'INI to JSON' mode. The tool parses [section] headers and key=value pairs, reconstructing nested objects from dot-notation keys. Comments (lines starting with # or ;) are ignored. Boolean, number, and null values are automatically detected.

Is my data secure?

Absolutely. All processing happens entirely in your browser. Your JSON and INI content is never sent to any server. No data is collected, stored, or transmitted. You can safely convert configs containing sensitive values like API keys and database passwords.

Real-world Examples

Python application config migration

Convert a JSON config file into INI format for a Python application that uses configparser, preserving section structure and dot-notation for nested values.

Input
{
  "app": {
    "name": "DataPipeline",
    "version": "2.1.0",
    "debug": false
  },
  "redis": {
    "host": "127.0.0.1",
    "port": 6379,
    "db": 0
  }
}
Output
[app]
name=DataPipeline
version=2.1.0
debug=false

[redis]
host=127.0.0.1
port=6379
db=0

Git-style config from JSON

Generate a Git-compatible configuration file from a JSON structure with user settings and remote URLs.

Input
{
  "user": {
    "name": "Jane Doe",
    "email": "[email protected]"
  },
  "remote": {
    "origin": {
      "url": "[email protected]:org/repo.git",
      "fetch": "+refs/heads/*:refs/remotes/origin/*"
    }
  }
}
Output
[user]
name=Jane Doe
[email protected]

[remote]
[email protected]:org/repo.git
origin.fetch=+refs/heads/*:refs/remotes/origin/*

Related Tools