INI to JSON Converter

Convert INI configuration files to JSON, and back. Auto-detect types (bool, int, float). Supports comments, sections, and multiple encodings.

1.0.0
Version
Auth
Batch

About INI to JSON Converter

INI is the format that refuses to die — Python's configparser still uses it, Windows still ships .ini files, half the legacy software on a typical server uses .cfg or .conf variants, and every game's saves directory has at least one. But INI's quirks — case-insensitive vs case-sensitive, comments with # or ;, encoding that might be UTF-8 or GBK or Latin-1, sectionless 'DEFAULT' keys — make hand-converting to JSON for a modern build pipeline tedious. And going the other way (JSON back to INI) is what you need when you have to update an app's config from a script.

This INI to JSON converter goes both directions and gets the small things right. INI → JSON auto-coerces value types — true / false become booleans, 42 becomes an integer, 3.14 becomes a float, everything else stays a string. The coercion toggle lets you keep all values as strings if your downstream tooling expects them that way. Section names and key order are preserved, both # and ; comments are tolerated, and encodings auto-detect across UTF-8, UTF-8 BOM, GBK and Latin-1 so legacy Chinese Windows configs don't garble. JSON → INI goes the other way — top-level keys become sections, nested objects become the key/value pairs inside them, with the file written as standard ConfigParser-compatible INI. The result is a clean round-trip you can drop into a CI pipeline or a config-migration script.

Use it to convert a legacy game.cfg into JSON for a modern web admin panel, transform Python setup.cfg blocks into a format your linter understands, generate per-environment INI files from a JSON template in a deployment pipeline, audit a large .conf file by viewing it as structured JSON, or convert Windows game saves so they can be edited in a JSON-aware tool. Files up to 10 MB are processed in a stateless serverless function and discarded immediately after the response.

INI to JSON Converter Use Cases

  • DevOps engineers converting legacy .conf files into JSON for a modern config pipeline
  • Generating per-environment INI files from a single JSON template in a CI/CD pass
  • Python developers turning setup.cfg or tox.ini blocks into JSON for linter pipelines
  • Game modders converting Windows .ini saves into JSON for diff-friendly editing
  • Migrating from .ini-driven legacy apps to modern config stores (Vault, Consul)
  • Audit workflows that need INI configs flattened into JSON for grep and pattern matching
  • Reading GBK-encoded Chinese Windows .ini files in a modern Linux toolchain

INI to JSON Converter Features

  • Two-way conversion — INI/CFG/CONF → JSON and JSON → INI in one tool
  • Auto type coercion — true/false to booleans, integers, floats, strings — with a toggle to keep everything as strings
  • Encoding auto-detect across UTF-8, UTF-8 BOM, GBK and Latin-1 so legacy Windows and Chinese configs don't garble
  • Tolerates both # and ; comments, sectionless 'DEFAULT' keys, and the quirks of various ConfigParser dialects
  • Section order and key case preserved so round-trip JSON→INI→JSON doesn't shuffle the file
  • JSON output ships with a section-by-section structure that downstream tools (yq, jq, jsonpath) can navigate easily
  • Files up to 10 MB processed in a stateless serverless function and discarded immediately after the response

How to Use INI to JSON Converter

Pick a direction

INI → JSON when you have a .ini, .cfg or .conf file and want structured JSON for a script, audit or modern config system. JSON → INI when you have a JSON config and need to write a ConfigParser-compatible INI for a legacy app.

Upload your file

Drag-and-drop or click to select. INI direction accepts .ini, .cfg, .conf and .properties extensions; JSON direction accepts .json. Files up to 10 MB each — covers the vast majority of real-world configs.

Pick coercion behaviour (INI → JSON)

Default: type-coerce — true/false become booleans, integers and floats become numbers, others stay strings. Untick to keep everything as strings — useful when your downstream code expects strings even for numeric-looking values.

Click Convert

The result panel shows a preview of the converted file and the section/key counts. JSON output is pretty-printed with 2-space indent; INI output uses the standard ConfigParser layout with one section per top-level JSON key.

Download the result

Click Download to save the converted file. INI output is UTF-8 encoded and uses LF line endings (LibreOffice, modern Python and most cross-platform tools handle this correctly). JSON output is UTF-8 with no BOM.

INI to JSON Converter FAQ

No. The file is uploaded to a stateless serverless function, parsed or generated, and deleted immediately after the response is sent. Nothing is logged to durable storage. For a config containing secrets (database passwords, API tokens), prefer a local Python script or a fully in-browser tool — ConfigParser and JSON are both in the standard library so this is a 10-line script.

Values that match the regex for an integer (-?[0-9]+) become integers. Values matching a float pattern with a decimal point become floats. Case-insensitive 'true' and 'false' become booleans. Everything else — including comma-separated lists, quoted strings, and numeric-looking values with units like '100ms' — stays a string. Untick coercion if your downstream tool expects all values as strings.

UTF-8 (with or without BOM), GBK, and Latin-1 (ISO-8859-1). Encoding is auto-detected — the parser tries UTF-8 first, falls back to GBK then Latin-1 if UTF-8 doesn't decode cleanly. This matters for legacy Windows Chinese configs (usually GBK) and old European apps (Latin-1). All output is written in UTF-8.

INI comments (lines starting with # or ;) are stripped — JSON has no comment syntax, so there's nowhere to put them. If preserving comments matters (e.g. you're round-tripping a documented config), use TOML or YAML instead, both of which support comments natively. Section and key order is preserved through the round-trip.

An object where each top-level key is a section name and the value is an object of that section's key/value pairs. Sectionless keys (under ConfigParser's implicit DEFAULT) land under a 'DEFAULT' key. The JSON is pretty-printed with 2-space indent and UTF-8 encoded with no BOM.

INI doesn't natively support nested sections — the format is flat sections with key/value pairs underneath. Some dialects use dotted section names like [parent.child] to imply nesting; this converter treats those as flat sections with literal dotted names. If your downstream tool needs real nesting, post-process the JSON with a small script that splits dotted keys into nested objects.

Python's configparser library does the parsing well but doesn't produce JSON — you script the bridge yourself. This tool gives you the bridge in the browser plus the reverse direction (JSON → INI) and the encoding auto-detect that configparser doesn't do natively. Use this for one-off conversions and audit work; use configparser directly when you're embedding INI handling inside a longer-running Python program.

Upload your .ini file

.ini, .cfg, .conf, .properties • Max 10MB

Requires login • 1 credit

INI to JSON Converter Tutorial

What is an INI file?

INI (initialization) files are a classic plain-text configuration format used by Windows, Python packages, MySQL, PHP, Samba, Git, and countless other tools. They look like:

[database]
host = localhost
port = 5432
debug = true

[auth]
secret = my-key

Why Convert to JSON?

  • JSON is easier to process with jq, Python, Node, or any programming language
  • Nested structures are explicit (INI only has flat sections)
  • Types (bool, int, float) are preserved
  • Works with tools that expect JSON input (API tests, CI pipelines)

Type Detection Rules

When "auto-detect types" is on, values are converted as follows:

  • true / yes / on → JSON true
  • false / no / off → JSON false
  • null / none → JSON null
  • 42, -7, 0xff → integers
  • 3.14, 1e-5 → floats
  • Everything else → strings

Supported Formats

  • .ini — Standard INI files
  • .cfg — Alternative extension
  • .conf — Unix-style config (basic INI subset)
  • .properties — Java-style (flat key=value)

Files without section headers are auto-wrapped in a [DEFAULT] section. Comments (# or ;) are stripped on conversion.