Overview
Introduction
INI is still the config format behind a lot of legacy tools, Windows application settings, PHP's php.ini, game server configs, even when the data you're starting from is JSON.
This tool converts a JSON object into that classic [section] / key=value layout so it can be dropped straight into a tool that expects INI.
What Is JSON to INI Converter?
A converter that maps a JSON object's top-level scalar keys into an implicit global section and its top-level object-valued keys into their own [section] blocks, mirroring how INI files are conventionally structured.
It targets one level of section nesting, the depth classic INI actually supports, rather than trying to invent a deeper nesting convention.
How JSON to INI Converter Works
The converter first writes any top-level scalar key=value pairs before any section header, the implicit global section INI parsers read first.
It then writes a [section] header for each top-level key whose value is an object, followed by that object's own key=value lines; arrays and non-object values are stringified onto a single line.
When To Use JSON to INI Converter
Use it when a legacy tool, PHP script, or Windows application expects an INI config file but your source data started life as JSON.
It's also handy for quickly previewing how a flat or shallow-nested JSON config would look in INI form.
Often used alongside INI to JSON Converter, JSON to TOML Converter and JSON to Properties Converter.
Features
Advantages
- Separates global keys from sectioned keys the way real INI parsers expect.
- Produces plain, dependency-free INI text with no extra formatting quirks.
- Runs entirely client-side, so config values never leave the browser.
Limitations
- Only one level of section nesting is supported; deeper nested objects get stringified rather than becoming their own subsections.
- Arrays have no native INI representation and are stringified onto a single line rather than expanded into indexed keys.
- Requires a JSON object (not an array) at the top level.
Examples
Best Practices & Notes
Best Practices
- Keep object nesting to one level before converting, since that's the deepest INI format itself supports.
- Avoid array values if the target INI consumer has no convention for representing lists.
- Review the generated file against your specific tool's INI dialect, some parsers are stricter about quoting or comments than others.
Developer Notes
The encoder writes global (non-object) keys first and section (object-valued) keys second regardless of their order in the source JSON, because INI parsers conventionally expect any keys before the first [section] header to belong to an implicit top-level section, and mixing them in source order would misplace keys under the wrong section when re-parsed.
JSON to INI Converter Use Cases
- Generating a php.ini-style or legacy application config file from JSON data
- Converting a JSON settings object into INI for a Windows-style application
- Previewing how a shallow JSON config would look in classic INI syntax
Common Mistakes
- Passing a top-level JSON array, which has no INI equivalent and will be rejected.
- Expecting a doubly-nested object to produce a nested section; INI only supports one level.
- Including array values and expecting them to expand into multiple keys rather than one stringified line.
Tips
- Use INI to JSON afterward to double-check the conversion round-trips the way you expect.
- For deeper nesting needs, JSON to TOML is a better fit since TOML natively supports nested tables.