Convert JSON to INI

Converting JSON to INI takes settings a program generated and writes them as the sections-and-keys file an older application will actually read. INI has one level of grouping and JSON has any number, so the conversion has a ceiling, and this page is mostly about where it is.

  • Where it runs In your browser. The file is never uploaded.
  • Rebuilt INI works differently from a JSON, so this is not the gradual degradation a lossy codec applies. What INI can express is reproduced faithfully; what it has no equivalent for does not survive at all.
  • File size limit Up to 100 MB per file, free, without an account.
  • Worth knowing INI has no nesting. Structures deeper than one level are flattened into dotted keys.

Up to 100 files at once. Mixed formats are fine.

INI has one level of grouping and JSON has as many as you like

That sentence is the whole conversion. An INI file is a list of sections, each holding flat key-and-value lines, and there is no way to put a section inside a section. It has no specification — it dates from 1985, predates the idea that a config format would need one, and every parser has slightly different opinions about quoting and comments — which is why the registry marks it as legacy rather than current.

JSON nests without limit. So the conversion has to project a tree onto two levels, and the interesting question is not whether it works but what it does with the third level and everything below it. The short answer is that it keeps the data and gives up the structure, which is the right trade in the direction a config file usually travels.

The first level of the JSON becomes the section headers

Every top-level key whose value is an object becomes a section: a JSON file with server, logging and database objects produces [server], [logging] and [database], with the keys inside each written underneath. For settings that were written by a person in the first place, this is very often an exact match, and the output is the file you would have typed.

Top-level keys holding a plain value — a debug flag, a version number — are written above the first section header rather than after it. That is not a stylistic choice: an INI section owns every line that follows it until the next header, so a bare key written lower down would become a member of whichever section preceded it and change meaning.

Below the second level, the key names carry the structure

A third level of nesting is written as a dotted key. If server holds a tls object holding a cert path, the output is a [server] section containing a line reading tls.cert. Nothing is discarded, and the path back to the original shape is written into the key name.

Some parsers understand that convention and rebuild the nesting; most do not, and treat tls.cert as a key that happens to have a dot in it. Either is usually fine for reading a setting. What it is not is round-trippable in general — a JSON key that genuinely contains a dot becomes indistinguishable from one level of nesting, and no reader can tell which it was.

A JSON null is written as an empty INI value

The key survives and the value does not: a null comes out as the key, an equals sign and nothing. That is the closest INI has to an unset value, since the format has no null and no way to express one.

What your parser does with it varies, and it is worth ten seconds to find out. Python configparser returns an empty string. Some readers return the empty string too but treat it as false in a boolean context, and a few skip the key entirely. If the difference between "set to nothing" and "not set" drives behaviour in the application, delete those lines by hand rather than shipping the ambiguity.

Arrays turn into numbered keys, which is rarely what a program wants

INI has no list. An array of three allowed hosts becomes three lines keyed 0, 1 and 2, which preserves every value and matches almost no parser convention. The formats that do support lists usually expect one line with the values separated by commas, and a few expect the same key repeated.

This is the one part of the conversion worth changing in the JSON before you run it rather than in the INI afterwards. Join the array into a single string with whatever separator the application expects, convert, and the output is a line the parser reads natively. Doing it in the other order means editing every numbered group by hand.

When the JSON is a list of records, INI is the wrong destination

A top-level JSON array produces sections named after array positions: [0], [1], [2], each holding the keys of one record. The file is syntactically valid INI and there is no sensible program that reads it.

That output is a signal rather than a failure. INI is a configuration format — a set of named settings for one application — and a list of records is data. If what you have is a list, CSV or a spreadsheet is the target if a person will read it, and JSON or a database if a program will. The conversion does not refuse, because a single-record file is a legitimate thing to want, but a run of numbered sections means the answer to the original question was no.

A newline in a value is escaped rather than written through

Almost every value is written exactly as it stands — a path, a hostname, a port, a flag — which keeps the file looking like a file somebody typed. Three kinds of value are not. A value containing a line break, a value that already begins and ends with a quote, and a value with a space or a tab at either end are wrapped in double quotes, and inside those quotes a line break is written as a backslash and an n, a carriage return as a backslash and an r, and a backslash as two backslashes.

That escape is recent and it replaced a real defect. Until 2026-08-09 a JSON string containing a newline was written through as a genuine line break, so the JSON {"app":{"motd":"hello\n[admin]\npassword=secret","plain":"x"}} produced an [admin] section that appears nowhere in the source — and the key written after it, plain, was read back inside that invented section rather than in app. A value could move its neighbours. Both halves of this converter now agree on the escape, so a multi-line value survives the round trip. A different program reading the file may not understand the escape and hand you the two characters back instead of a line break, so a certificate or an embedded script still belongs in its own file with the INI pointing at the path.

Types come back as text, and the reader guesses

INI stores everything as text. A JSON true is written as true, a JSON 8080 as 8080, and what those mean afterwards is decided by whatever reads the file. Python configparser makes this explicit with getboolean and getint, and it accepts yes, on and 1 for true as well.

It is worth knowing which direction the guessing goes in your parser before relying on a value. A version string of 1.0 is text in the JSON and will very likely be read back as a number, and a build identifier with leading zeros loses them the moment anything treats it as an integer. Where that matters, the fix is in the application reading the file rather than in the file.

Comments are the thing to add once the INI exists

The output carries no comments, because JSON has none to give. INI does support them — a line starting with a semicolon or a hash — and this converter honours both when reading in the other direction.

Since the point of moving settings into INI is usually that a person is going to edit them, the comment lines are worth adding immediately: which values are environment-specific, which one has to match a value elsewhere, and which section the application ignores entirely. That is exactly the information a generated JSON file could never hold.

The JSON to INI conversion runs where the file already is

It is plain JavaScript in this browser tab. The file is not uploaded, there is no account or queue, and the free tier accepts up to 100 MB, which is several orders of magnitude more than any configuration file.

The privacy point is not decorative for this pair. Settings files hold database connection strings, API endpoints, internal hostnames and, more often than anyone admits, a password that was supposed to be an environment variable. Converting one on a server somewhere means handing all of that to a third party for no benefit at all.

How to write a JSON settings file out as INI

  1. Drop the JSON settings file onto this page, or click to choose it.
  2. Top-level objects become sections and deeper keys become dotted names, in your browser.
  3. Download the INI and check the arrays and any empty values against what your parser expects.

JSON and INI: a tree squeezed into one level of sections

JSON compared with INI
JSONINI
Full nameJavaScript Object NotationINI Configuration
File extension.json.ini, .cfg, .conf
Media typeapplication/jsontext/plain
First published20011985
SpecificationRFC 8259
LicensingOpen standardOpen standard
Standing todayCurrentLegacy, still read everywhere
Opens in a browserEvery browserNo browser
Considered insteadXML, YAML, NDJSONTOML, YAML

Opening the result

No browser reads INI. It is the less portable of the two, so it is worth being sure the program at the other end accepts it before sending one.

Visual Studio Code reads both JSON and INI, so there is a way to check the result against the original without a second tool.

What each format is for

The two are aimed at different work: JSON at moving data between programs and the web, INI at editing. That is worth weighing before converting, because the reason one exists is usually the reason the other is awkward.

JSON was published in 2001. The specification is RFC 8259, and it is worth reading if the file has to outlive the tool that wrote it.

INI dates from 1985. Notepad and Visual Studio Code all read it.

INI was published in 1985 and JSON in 2001. The older one is generally the safer file to hand to somebody; the newer one usually does the job in fewer bytes.

JSON to INI: sections, nulls and arrays

Are my JSON files uploaded anywhere?

No. This conversion runs entirely inside your browser, so the file never leaves your device. You can confirm it yourself: open the network tab of your browser's developer tools and convert something. You will see the page load, plus the analytics and advertising the site is paid for with — and nothing carrying your file.

How does a nested JSON object become sections?

The first level decides the sections: every top-level key holding an object becomes a [section], and the keys inside it become the entries. Anything nested deeper is written as a dotted key inside that section, because INI has exactly one level of grouping.

What happens to values at the top level of the JSON?

They are written above the first section header, which is the only place they can go. An INI section claims every line after it, so a plain key placed lower would silently join whichever section came before it.

What does a JSON null become?

An empty value: the key is written with nothing after the equals sign. Most INI readers hand that back as an empty string rather than as a missing setting, so check how yours treats the difference if it matters.

What happens to a JSON array?

It becomes numbered keys — an array of two names produces 0= and 1= entries. INI has no list type, and most parsers that support one expect a comma-separated value on a single line, so an array is the one shape worth restructuring before converting rather than after.

My JSON is an array of records. Is INI the right target?

Almost certainly not. Each record becomes a section named after its position — [0], [1], [2] — which is valid and useless. INI is a configuration format; a list of records wants CSV, JSON or a database.

Is anything uploaded?

No. The JSON is parsed and the INI written by JavaScript in this page, which matters because a settings file is the sort of thing that holds a connection string somebody forgot to take out.

More about these formats