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
- Toggle the conversion direction using the arrow button: JSON to INI or INI to JSON
- Paste your structured JSON object or INI text into the left panel
- Click Convert to produce the translated output on the right
- Review the result — nested JSON objects are flattened with dot notation in INI mode
- Copy the output directly into your project's config directory
Why Use This Tool?
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.
{
"app": {
"name": "DataPipeline",
"version": "2.1.0",
"debug": false
},
"redis": {
"host": "127.0.0.1",
"port": 6379,
"db": 0
}
}[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.
{
"user": {
"name": "Jane Doe",
"email": "[email protected]"
},
"remote": {
"origin": {
"url": "[email protected]:org/repo.git",
"fetch": "+refs/heads/*:refs/remotes/origin/*"
}
}
}[user] name=Jane Doe [email protected] [remote] [email protected]:org/repo.git origin.fetch=+refs/heads/*:refs/remotes/origin/*