Config File Formatter
Auto-detect and beautifully format INI, JSON, and ENV files.
What the Config File Formatter does
Configuration files tend to pick up messy spacing over time: one developer writes port=3306, another writes port = 3306, and a minified JSON blob arrives from an API on a single line. This tool takes whatever raw configuration you paste in, works out whether it looks like JSON or INI, and returns a cleaner version you can read at a glance.
Using it step by step
- Paste your configuration into the Input Data box. If you just want to see how it behaves, press Sample to load a small INI example.
- Click Process / Generate.
- Check the line above the output that reads Detected Format. It will say JSON, INI or ENV/Text.
- Use Copy to put the result on your clipboard, or Download to save it as result.txt. Clear empties the input box so you can start over.
How each format is handled
- JSON: if the text starts with a brace or bracket and parses successfully, it is re-indented with four spaces per level.
- INI: if the text contains square brackets and is not valid JSON, each [section] header is placed on its own line and every key = value pair beneath it is indented and colour-coded.
- Everything else: treated as ENV/Text. Equals signs get a space on each side and all runs of whitespace are collapsed.
Where it helps
- Reading a minified JSON settings file copied from a log or a support ticket.
- Cleaning up a php.ini or my.cnf snippet before pasting it into documentation.
- Checking that a section header was not accidentally merged with the line above it.
- Making a config diff easier to review by normalising spacing first.
Things to keep in mind
Detection is simple pattern matching, not a full parser. Invalid JSON that begins with a brace will fall through to the INI or text rules, so a missing comma will not produce an error message. An INI file with no square brackets is treated as ENV/Text, and in that mode line breaks are collapsed too, which flattens multi-line files into one line. If you have a real .env file, the dedicated .env Formatter keeps one variable per line and is the better choice.
Comments in INI files (lines starting with a semicolon or hash) are kept but shown in a muted style rather than coloured as keys. Processing happens with JavaScript in your browser page, so the result appears instantly without a page reload.
Related Articles
- YAML Config Files: A Practical Guide With Examples
- ENV Files: Managing App Configuration the Right Wa
Related Tools