Shard Tools

JSON to INI

Turn JSON into an INI configuration file in your browser, with objects becoming sections.

Maintained by Roshan.

Use JSON to INI

Converts JSON into INI in this tab. Configuration files routinely hold hostnames, keys and credentials, so nothing here is sent anywhere.

Values are never retyped as numbers or booleansGuessing types is how a converter turns a postcode of 0123 into 123, or a literal string of false into a boolean. Values are carried across as they were written, and casting is left to you where it matters.

Explore developer and data tools

Find related browser-local tools for nearby tasks without starting another search.

Browse all developer and data tools

About JSON to INI

Writing INI from JSON is mostly a question of what to do with structure that INI cannot express. The format is flat by design: a set of key and value pairs, optionally grouped under section headers, and that is the entire vocabulary. JSON is a tree. So the conversion maps the one level of grouping INI has onto the top level of your object, turns nested objects into sections, and writes everything else as a plain key. The detail that catches people out is ordering. A key written after a section header belongs to that section, so any top-level setting emitted below one would silently be absorbed into it when the file is read back. This converter emits unsectioned keys first for exactly that reason.

Work through the input

  1. Top-level properties whose value is an object become INI sections, with their contents written as the keys inside.
  2. Top-level properties with a simple value are written as plain keys, and they are always emitted before the first section header.
  3. Arrays and deeply nested objects are serialised as JSON text within the value, since INI has no syntax for either.
  4. Values are written exactly as they appear, with no quoting added, because unquoted values are the convention and quotes would become part of the text in some readers.
  5. The output uses the equals sign, which is the most widely accepted of the separators INI readers understand.

When json to ini is useful

Generating a config from a template

Build the structure in JSON where it is easy to manipulate, then emit INI for the tool that needs it.

Migrating settings between tools

Convert the source to JSON, adjust the keys, then write INI. The intermediate step is much easier to script against.

Check the output

Questions about JSON to INI

How do I control which parts become sections?

Any top-level property whose value is an object becomes a section. Everything else becomes a plain key at the root.

What happens to arrays?

They are written as JSON text inside the value, because INI has no array syntax at all.

Why are the unsectioned keys at the top?

Because a key written after a section header belongs to that section. Emitting them first is the only way they survive a round trip.

Are values quoted?

No. Unquoted is the convention, and some readers would treat added quotes as part of the value.

Does the data leave my device?

No. The conversion happens entirely in this tab.

Related tools

INI to JSON

Turn an INI configuration file into JSON in your browser. Sections become nested objects and values stay strings.

JSON to ENV

Turn a JSON object into .env format in your browser, with keys upper-cased and values quoted where a shell needs it.

JSON to YAML

Convert JSON into clean, readable YAML in your browser. Useful for Kubernetes manifests, CI pipelines and application config.