Home › Developer Tools › INI to JSON Converter

INI to JSON Converter

Paste an .ini, .cfg or .conf file and get structured JSON, or switch direction to write JSON as an INI file. Sections, comments, quoted values, arrays and number or boolean detection are all handled, and errors point to the exact line.

Last updated:

Everything runs in this tab; your config files are never uploaded. Drop a file on the input. Tip: Ctrl + Enter converts.

Advertisement
Advertisement

How to use the INI to JSON Converter

  1. Choose the direction: INI → JSON or JSON → INI.
  2. Paste your file, drop it on the input or press Open. A sample config is loaded to start.
  3. Adjust parsing: type detection, nested sections, inline comments and duplicate keys (or array style and separator for INI output).
  4. Check the result on the right. Errors show the line and a Show in input button.
  5. Copy or download the output, or press Swap direction to convert it back.

INI syntax supported

INIJSON result
name = Cabin"name": "Cabin"
port = 8080"port": 8080 (with type detection)
timeout: 30"timeout": 30 (colon separator)
[server]"server": { … }
[database.pool]"database": { "pool": { … } }
host[] = a
host[] = b
"host": ["a", "b"]
env[prod] = yes"env": { "prod": "yes" }
msg = "Hi\nthere" ; note"msg": "Hi\nthere"
pass = 'a;b#c'"pass": "a;b#c"
flag (no =)"flag": null

Where INI files are used

  • php.ini and other PHP configs, which also popularised the key[] array syntax.
  • Python setup.cfg, tox.ini and pytest.ini, read by the configparser module.
  • Windows desktop.ini and many older application settings files.
  • Git config, systemd unit files and MySQL my.cnf use the same section and key layout.

Moving a config to a newer format? Convert the JSON on to YAML with JSON to YAML, or handle environment files with the ENV to JSON converter.

Frequently asked questions

Is there an official INI standard?

No. INI is an informal format, and Windows, PHP, Python configparser, Git and others differ in details. This converter accepts the common superset: [sections], key = value or key: value, ; and # comments, quoted values, key[] arrays and backslash line continuation.

How are sections converted to JSON?

Each [section] becomes an object holding its keys. Keys that appear before the first section are placed at the top level. With Nest [a.b] sections on, [database.pool] becomes a pool object inside database; turn it off to keep "database.pool" as one key.

Are values converted to numbers and booleans?

With type detection on, unquoted values like 8080, 3.2, true, false and null become JSON numbers, booleans and null. Values with leading zeros, such as 02134, and any quoted value stay strings. yes/no/on/off are only converted if you tick that option, so a value like no (Norway) is not turned into false by accident.

How do I write an array in INI?

Repeat the key with empty brackets, like replica[] = host1 and replica[] = host2, which gives "replica": ["host1", "host2"]. Alternatively set Duplicate keys to Collect into array to turn repeated plain keys into arrays.

When is a ; or # treated as a comment?

A line starting with ; or # is always a comment. Inside a value, ; or # starts a comment only when it follows a space, so p@ss#1 stays intact. Put a value in quotes to keep a ; or # that follows a space, or turn off Strip inline comments.

How is JSON converted to INI?

Top-level plain values are written as global keys, objects become [sections], deeper objects become [parent.child] sections, and arrays of plain values become key[] lines or a comma list. Strings that would otherwise be read as numbers, booleans or comments are quoted so they convert back unchanged.

Is my file uploaded?

No. The INI parser and JSON writer run in JavaScript in this page, so passwords and keys in your config never leave your device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.Properties to YAML ConverterConvert Java .properties to nested YAML (application.yml) and YAML back to properties.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to HTML TableTurn CSV into clean HTML table code with a live preview, styling options and one-click copy.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.HTML Table to CSVExtract any table from HTML or page source to CSV, TSV or JSON, with colspan and rowspan handled.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.JSON to Dart ClassTurn JSON into Dart model classes with fromJson, toJson, null safety and nested classes.JSON to Java ClassTurn JSON into Java POJOs or records with Lombok, getters/setters and Jackson or Gson annotations.JSON to Kotlin Data ClassTurn JSON into Kotlin data classes for kotlinx.serialization, Gson, Moshi or Jackson.JSON to Markdown TableTurn a JSON array of objects into a GitHub Markdown table with column picker and alignment.JSON to PHP ArrayConvert JSON to PHP array code (short [] or array()) and PHP arrays back to JSON.JSON to Rust StructTurn JSON into Rust structs with serde derives, rename attributes, Option and Vec types.JSON to SQL ConverterConvert a JSON array of objects to CREATE TABLE and INSERT statements for MySQL, Postgres, SQLite.JSON to Swift StructTurn JSON into Swift Codable structs with CodingKeys, optionals and nested types.JSON to TOML ConverterConvert JSON to clean TOML with tables, arrays of tables, inline tables and dates.JSONL to JSON ConverterConvert JSON Lines / NDJSON to a JSON array and back, with line-level error reports.PX to EM ConverterConvert pixels to em using the parent font size, and em back to px, with conversion tables.Query String to JSONConvert URL query strings to JSON with nested brackets and arrays, and JSON back to a query string.REM to PX ConverterConvert CSS rem values to pixels for any root font size, with a quick 0.25–6rem table.SQL to JSON ConverterConvert SQL INSERT statements and dumps into a JSON array of row objects, with CSV export.TSV to CSV ConverterConvert TSV to CSV and back, or between tab, comma, semicolon and pipe, with correct quoting.
See all 129 Data & File Format Converters →