INI File Parser & Formatter
Parse INI, .cfg and .conf files into JSON or reformat them, with line-numbered warnings for duplicate keys and bad syntax.
Parser options (1 on)
Warnings
Parsed output
Paste an INI file above to see the parsed result instantly.
How it works
INI has no formal standard โ there is no RFC for it. This parser is hand-written and follows
the conventions shared by Python’s configparser, the Windows
GetPrivateProfileString family and the widely used Node ini package.
Section headers are [name], a key and value are split at the first =, whole-line comments start with ; or #, and keys that
appear before any section header become top-level keys in the output. Keys and values are both
trimmed. Values wrapped in double quotes keep their inner whitespace and understand the escapes
\n, \t, \r, \\, \" and
\;; single-quoted values are taken literally. Everything else is kept exactly as
written, so a Windows path such as C:\data\app survives untouched.
Three options let you match your own dialect. Convert numbers and true/false to real
JSON types is on by default and turns unquoted
true, false, yes, no, on and
off into JSON booleans, null/none/nil into
null, and plain numbers into JSON numbers (values with a leading zero, like
0755, stay strings so nothing is lost). Strip inline comments cuts
a value at whitespace followed by ; or #; it is off by default because
plenty of real values contain a #. Allow : accepts
key: value as well. Anything ambiguous is reported as a numbered warning rather
than silently dropped: duplicate keys (last one wins), repeated sections (merged), unterminated
quotes and lines with no separator.
Switch the output to Formatted INI to tidy a messy file instead: uniform
key = value spacing, one blank line between sections, duplicates resolved, and
values re-quoted only where they need it. Parsing runs entirely in JavaScript on your device,
so config files holding database passwords, API keys or internal hostnames are never uploaded.
Frequently asked questions
How do I convert an INI file to JSON?
Paste the contents of your .ini, .cfg or .conf file into the input box and the JSON appears instantly below it. Sections become nested objects, keys written before any [section] header stay at the top level, and you can pick 2-space, 4-space or minified JSON before hitting Copy or Download. There is nothing to install and no account needed.
Which INI dialect does the parser follow?
INI has no formal standard or RFC, so this hand-written parser follows the conventions shared by Python configparser, the Windows GetPrivateProfileString family and the Node ini package: [section] headers, a split at the first =, whole-line comments starting with ; or #, trimmed keys and values, and double-quoted values that honour \n, \t, \r, \\ and \". Optional switches let you allow : as a separator or strip inline comments if your dialect uses them.
Why are my numbers and true/false values coming out as strings?
By default nothing is coerced, because INI values are plain text and guessing can lose data. Tick "Infer types" to turn unquoted numbers into JSON numbers, true/false/yes/no/on/off into booleans and null/none into null. Values with a leading zero, such as 0755, stay strings so file modes and zip codes survive, and any value you wrap in quotes is always kept as text.
Is it safe to paste a config file with passwords in it?
Yes. The parser runs entirely in JavaScript on your own device, so the file is never uploaded, stored or logged. That makes it safe for php.ini, .gitconfig, tox.ini and application configs containing database passwords, API keys or internal hostnames.