1. Getting Started
There are three ways to get your data into the formatter:
- Paste Directly: Simply paste your code into the left-hand input panel.
- File Upload: Click the Upload
button to select a
.jsonor.txtfile from your computer. - Drag & Drop: Drag a file from your desktop directly onto the editor area.
2. Formatting & Minifying
Once your data is loaded, you can transform it using the toolbar buttons:
-
Beautify (2 or 4 Spaces)
Expands the code into a readable structure with proper indentation. 2 spaces is standard for JavaScript/JSON; 4 spaces provides more visual separation.
-
Minify
Removes all whitespace and newlines to compress the data. Ideal for production environments to save bandwidth.
3. Repairing Invalid JSON
It's common to copy object data from JavaScript files that isn't technically valid JSON. Our Magic Fix feature solves this automatically.
What it Fixes:
- Trailing Commas:
{"a": 1,}→{"a": 1} - Single Quotes:
{'a': 'b'}→{"a": "b"} - Unquoted Keys:
{id: 1}→{"id": 1}
Simply click the Fix button in the toolbar if you see a red error banner.
4. Converting to Other Formats
Developers often need to translate JSON into other formats for config files or data analysis. Use the Convert To... dropdown to switch modes:
Generates TypeScript interfaces/types automatically. Great for API response typing.
Converts to YAML. Essential for DevOps, Kubernetes, and configuration files.
Flattens nested JSON into rows and columns. Perfect for Excel or Google Sheets analysis.
5. Exploring with Tree View
For large, deeply nested files, the standard text view can be overwhelming. Switch to the Tree tab to browse your data interactively.
- Expand/Collapse: Click arrows to open or close objects.
- Deep Search: Use the filter input to find specific keys or values. The tree will automatically expand to show matches.
- Visual Types: Strings, numbers, and booleans are color-coded for easier scanning.