🔒 Runs in your browser — nothing is uploaded✓ Free, no signup
Free JSON Formatter & Validator
TrueFormatter helps developers format, validate, and auto-fix invalid JSON instantly — no signup, no upload, fully private.
When should you use this JSON tool?
- Fix “Unexpected token” errors from broken JSON
- Pretty-print API responses for debugging
- Minify JSON for storing or sending over network
Example (broken JSON):
{
name: "TrueFormatter",
tools: ["formatter","validator",],
// comment
version: 1
}Tip: Click Validate to see the error, then use Fix JSON to auto-repair common issues (unquoted keys, trailing commas, comments).
How to use the JSON Formatter
- 1
Paste your JSON
Paste minified, messy or broken JSON into the input editor — an API response, a config file or a log line.
- 2
Click Beautify or Minify
Beautify indents the JSON so it is easy to read. Minify removes all whitespace to make it as small as possible.
- 3
Fix errors automatically
If the JSON is invalid you'll see the error. When it can be repaired, click Fix JSON to correct unquoted keys, single quotes, trailing commas and comments in one go.
- 4
Copy or download
Copy the result to your clipboard or click Download to save it as a .json file.
Examples
Minified API response → readable JSON
Before
{"id":42,"user":{"name":"Ada","roles":["admin","dev"]},"active":true}After Beautify
{
"id": 42,
"user": {
"name": "Ada",
"roles": [
"admin",
"dev"
]
},
"active": true
}Broken JavaScript-style object → valid JSON
Fix JSON quotes the keys, swaps single quotes for double quotes, and removes the comment and trailing comma.
Before
{
name: 'TrueFormatter', // app name
tags: ['json', 'tools',],
}After Fix JSON
{
"name": "TrueFormatter",
"tags": [
"json",
"tools"
]
}Common errors and how to fix them
Unexpected token } in JSON- There is a trailing comma before a closing } or ]. Click Fix JSON, or delete the last comma.
Expected double-quoted property name- A key is unquoted or uses single quotes, which is valid JavaScript but not JSON. Fix JSON adds the double quotes for you.
Unexpected token < in JSON at position 0- You pasted HTML, not JSON — usually an error page returned by a server or proxy. Check the status code and response of your API call.
Unexpected end of JSON input- The JSON is cut off: a closing bracket is missing or the copy was truncated. Copy the full response again.
Large numbers change after formatting- JavaScript numbers lose precision beyond 2^53 (9007199254740991), so 64-bit IDs can change. Have your API send such IDs as strings.
Invisible character at the start of the file- Files saved with a UTF-8 BOM start with an invisible \uFEFF character. Delete the first character or re-save the file as UTF-8 without BOM.
More from JSON Tools
Free tools that run in your browser — no signup, nothing uploaded.
JSON Validator & Linter
Check JSON syntax and see the exact line and column of every error.
JSON Viewer (Tree)
Explore JSON as a collapsible tree with search and click-to-copy paths.
JSON Editor
Edit JSON with live validation, a tree view, formatting and key sorting.
JSON Beautifier
Pretty-print and indent JSON for easy reading and debugging.
JSON Compare & Diff Tool
Find the difference between two JSON objects visually and quickly.
JSON Sorter (Sort Keys)
Sort JSON object keys alphabetically, including nested objects.
JSONPath Tester
Evaluate JSONPath expressions with filters and recursive queries.
JSON Schema Generator
Generate a JSON Schema from any sample JSON document.
JSON to CSV Converter
Flatten nested JSON arrays into CSV for spreadsheets.
Frequently Asked Questions
TrueFormatter is a free online developer tool that helps you format, validate, and beautify JSON instantly, making it easy to read and debug.
Formatting JSON online saves time, requires no installation, and works directly in your browser without storing your data.
Paste your JSON into the editor and click the Beautify or Format button. Your JSON will be formatted instantly.
Yes. TrueFormatter includes an Auto-Fixer that can repair common JSON syntax issues and convert them into valid JSON.
The Auto-Fixer can fix missing commas, remove trailing commas, strip JSON comments, quote unquoted keys, and convert single quotes to double quotes.
Click the Validate button. If your JSON is invalid but repairable, you will see a Fix JSON option for one-click repair.
