JSON Tools

Format, validate, minify, compare and explore JSON — instantly, in your browser.

No data leaves your browser
Input
JSON Validator
Input
Minify JSON
Input
Compare two JSON objects
JSON A
JSON B
Tree Explorer
Input
Mode
Input
Order
Input
Mode
Input
Fix broken JSON & LLM output
Broken JSON
JSON
Matches

Frequently Asked Questions

Is the JSON formatter free?

Yes, completely free with no account, login, or signup required. All features are available immediately.

Is my JSON data safe?

All processing happens entirely in your browser. Your JSON is never sent to any server.

What JSON tools are included?

Format (pretty print), Validate, Minify, Tree viewer, Escape/Unescape, Sort keys, Flatten, and Compare two JSON objects.

Does it handle large JSON files?

Yes. The formatter handles large JSON files efficiently in the browser without sending data to a server.

Can I share JSON via a URL?

Yes. Click the Share button to copy a link that restores your JSON and active tab when opened.

What is JSON?

JSON (JavaScript Object Notation) is a lightweight text format for storing and exchanging data. It is human-readable and widely used for APIs, configuration files, and data storage.

How do I format JSON with indentation?

Paste your JSON into the Format tab and choose 2 spaces, 4 spaces, or Tab indent. Click Format to pretty-print it instantly.

How do I validate JSON syntax online?

Switch to the Validate tab, paste your JSON, and the tool highlights exactly which line contains a syntax error.

What is the difference between JSON and a JavaScript object?

JSON is a text string — keys must be double-quoted and trailing commas are not allowed. A JavaScript object is runtime data that allows unquoted keys and functions.

How do I minify JSON for production?

Use the Minify tab. It strips all whitespace and newlines, reducing payload size for HTTP responses and storage.

Can I sort JSON keys alphabetically?

Yes. The Sort tab recursively sorts all object keys alphabetically, which helps with diffing and version control.

What does 'unexpected token' mean in JSON?

It means the parser found a character it did not expect — common causes are a trailing comma, an unquoted key, or a single-quoted string.

How do I compare two JSON objects?

Use the Compare tab. Paste two JSON values and the tool highlights keys that differ, are missing, or have different types.

How do I fix broken or invalid JSON?

Open the Repair tab and paste it. Brace fixes missing or trailing commas, single quotes, unquoted keys, comments, Python True/False/None, unescaped newlines and missing closing brackets, then shows you exactly which lines changed.

Why does ChatGPT or Claude return invalid JSON?

Language models generate text token by token, so replies often wrap JSON in markdown code fences or explanations, use single quotes, add trailing commas, or get cut off at the output limit. The Repair tab strips the surrounding text and fixes these issues in your browser.

How do I test a JSONPath expression?

Open the JSONPath tab, paste your JSON and type a path such as $.store.book[*].author or $..book[?(@.price<10)]. Matches update live, and you can switch between values, paths and JSON Pointers.

How do I flatten nested JSON?

Use the Flatten tab. It converts deeply nested objects into a single-level object using dot notation keys, e.g. user.address.city.

More Developer Tools

JSON ToolsFormat, validate, minify & compare JSON JSON FormatterPretty-print and beautify JSON CSV Viewer & EditorView, edit and convert CSV files YAML ConverterConvert YAML to JSON and back Regex TesterTest regular expressions live Text DiffCompare two texts side by side JWT ToolDecode, encode, compare and verify JWTs JWT DecoderInspect JWT header and payload XML FormatterFormat, validate and convert XML URL EncoderEncode, decode and parse URLs Base64Encode and decode Base64 strings Hash GeneratorSHA-256, MD5, HMAC and CRC32 SHA-256Generate SHA-256 checksums MD5 GeneratorGenerate MD5 hash values Text ToolsCase convert, count and transform text Number ConverterBinary, hex and octal converter Token CalculatorEstimate LLM token counts from text PDF EditorEdit text, sign and annotate PDFs Schema GeneratorJSON to TypeScript, Go, Rust, Python IndexNowSubmit URLs to Bing, Yandex & more PII RedactorMask personal data & keys before AI Timestamp ConverterUnix epoch to date and back UUID GeneratorUUID v4/v7, ULID, Nano ID Password GeneratorSecure passwords & passphrases MCP Config BuilderConfigs for Claude, Cursor, VS Code AGENTS.md GeneratorCLAUDE.md, Cursor rules, Copilot AI Crawler Controlsrobots.txt for AI bots & llms.txt Cron ParserExplain crontab, next run times SQL FormatterBeautify & minify SQL queries cURL ConvertercURL to fetch, Python, Go, PHP Chat Export ConverterChatGPT/Claude export to Markdown Markdown PreviewLive GFM preview & to HTML Color & ContrastHEX/RGB/OKLCH, WCAG checker QR Code GeneratorURL, Wi-Fi, vCard; PNG & SVG Tool Schema ConverterOpenAI ↔ Anthropic ↔ Gemini ↔ MCP JSONL ValidatorFine-tuning & batch files SSE Stream ParserReassemble LLM streaming responses Prompt Template & DiffFill {{vars}}, compare versions