JSON Formatter
1
Tree — browse the parsed JSON as a collapsible tree.
Filter — query array items by attribute: pick a field, an operator, and a value, then combine multiple conditions with AND / OR. No query syntax to learn.
1
Tree — browse the parsed JSON as a collapsible tree.
Filter — query array items by attribute: pick a field, an operator, and a value, then combine multiple conditions with AND / OR. No query syntax to learn.
Paste raw, minified, or broken JSON and get clean, indented output with a single click. When the syntax is invalid, the error message includes the exact line number and character position — not just "unexpected token". Everything runs in your browser using JavaScript.
There is no upload limit, no account, and no data sent to any server. Paste your JSON and the formatter handles indentation, minification, and copy-to-clipboard output — all client-side.
Once your JSON is formatted, switch the right-hand panel from Tree to Filter to run a JSON query without writing any query syntax. Just Formatter scans your document for every array of objects — including ones nested inside other objects — and lets you filter it by attribute value directly in the tree view.
Unlike JSONPath or JMESPath testers, there are no path expressions to memorize. Pick an attribute from a dropdown (nested fields like address.city are detected automatically), choose equals or contains, and type a value. Add more conditions and toggle AND / OR to combine them — for example role equals admin AND city contains Delhi.
The result updates instantly and shows a live match count, with the rest of the JSON document left intact around the filtered array — so you can see exactly where the matching records sit in the full structure. As with every tool on this site, filtering runs entirely in your browser; your data is never uploaded.
For a deeper walkthrough — plain JavaScript, JSONPath, JMESPath, jq, and common pitfalls — see How to Filter a JSON Array by Attribute Value.
JSON filter vs. JSONPath / JMESPath
Query languages like JSONPath ($.users[?(@.role=='admin')]) and JMESPath are powerful but require learning their syntax. Just Formatter's JSON filter is built for the common case — filtering an array by one or more attribute values — with no expressions to write.
JSON supports exactly six value types. Every valid JSON document is built exclusively from these primitives:
"Hello, world!"42 3.14 -7 1.5e10true falsenull["a", 1, true, null]{"key": "value", "count": 3}These are the most frequent JSON syntax errors developers encounter. Paste your broken JSON into the formatter above to find the exact line of the error.
A comma after the last property of an object or the last element of an array is invalid JSON. JavaScript allows trailing commas in code, which trips up developers who hand-write JSON config files.
Invalid
{"name": "Alice", "age": 30,}Fix
{"name": "Alice", "age": 30}JSON requires double quotes for both keys and string values. Single quotes and unquoted keys are valid JavaScript object syntax but not valid JSON.
Invalid
{name: 'Alice'}Fix
{"name": "Alice"}Your API call received an HTML error page instead of JSON. This usually means a 404 or 500 error. Check the HTTP response status code and the endpoint URL.
Invalid
<!DOCTYPE html>...Fix
Check the request — the server returned HTML, not JSON.Standard JSON does not support comments. Config files like tsconfig.json use JSONC (JSON with Comments). If you need comments, use a JSONC-aware parser or move comments out-of-band.
Invalid
{"host": "localhost" // dev only}Fix
Remove the comment. Use JSONC format for comment support.Each key-value pair in an object must be separated by a comma. Missing commas are easy to introduce when adding new fields to existing JSON.
Invalid
{"a": 1 "b": 2}Fix
{"a": 1, "b": 2}Backslashes in string values must be escaped as \\. Newlines must be \n, not an actual line break inside a string value.
Invalid
{"path": "C:\Users\Alice"}Fix
{"path": "C:\\Users\\Alice"}JSON is the de facto data interchange format for REST APIs. When you call an API endpoint and the response is a wall of minified text, pasting it into a formatter immediately reveals the structure — the nested objects, the array lengths, the exact field names. This is the most common use case for a JSON formatter in day-to-day development.
API debugging pattern: Copy the raw response from your browser's DevTools Network tab (right-click → Copy → Copy Response), paste it into Just Formatter, and use the prettified output to understand what the API is actually returning. If the formatter throws an error, the response is not valid JSON — check the Content-Type header and HTTP status code.
Configuration files like package.json, tsconfig.json, and appsettings.json must be valid JSON (or JSONC). A misplaced comma or missing brace will break your build or runtime. Use the validator before committing config changes.
Minification is the reverse — taking readable JSON and removing all whitespace to produce the smallest possible representation. Useful for reducing API payload size or embedding JSON literals in code. The minify button produces compact output you can paste directly into a request body or a string constant.
There are two different types of JSON validation that developers often confuse:
Syntax Validation
Checks whether the document is valid JSON — correctly quoted strings, balanced brackets, no trailing commas. This is what Just Formatter does. A syntax-valid document can be parsed by any JSON parser.
Schema Validation
Checks whether the document conforms to a specific structure — required fields, value types, format constraints (like "email" or "date-time"). Requires a JSON Schema definition and a schema validator library.
If your JSON is syntactically valid but your API is still rejecting it, the issue is probably schema validation — a required field is missing, a string is in the wrong format, or a number is out of the allowed range. Read the API error response carefully; schema validators typically return specific field-level error messages.
For a deeper look at the difference, see the blog post on JSON Schema validation vs. JSON Lint.
The most common culprits are a trailing comma after the last element, single-quoted strings instead of double-quoted, or an actual HTML error response being mistaken for JSON. Paste it into the formatter above — the error message includes the exact line and character position.
JSON.parse() converts a JSON string into a JavaScript object. JSON.stringify() converts a JavaScript object back into a JSON string. The formatter above uses JSON.parse() for validation and JSON.stringify(result, null, 2) for prettifying with 2-space indentation.
Yes. The formatter runs entirely in your browser with no file size limit imposed by the tool. Files over 10 MB may slow down the browser tab during parsing. For very large datasets, consider using a CLI tool like jq or Python's json.tool module instead.
Douglas Crockford, who standardized JSON, deliberately excluded comments to prevent developers from using JSON files as configuration with embedded directives. If you need comments in config files, use JSONC (supported by TypeScript and VS Code) or YAML instead.
All processing runs in your browser using JavaScript. Nothing is sent to a server. You can verify this by watching the Network tab in your browser's DevTools while using the formatter — no outbound requests are made.
Format your JSON, then switch the preview panel to Filter mode. Pick the array to filter (Just Formatter auto-detects every array of objects in your JSON, including nested ones), add a condition — attribute, equals or contains, and a value — and the tree view updates instantly to show only matching items.
A JSON query tool lets you extract or filter data from a JSON document without writing code. Some tools use a query language like JSONPath or JMESPath, which requires learning path syntax. Just Formatter's JSON filter is point-and-click instead — pick an attribute from a dropdown, choose equals or contains, and enter a value, with no query expressions to write.
Yes. The JSON filter automatically discovers nested attributes up to three levels deep (for example address.city) and lists them alongside top-level fields, so you can filter on nested values the same way as flat ones.
Yes. Add multiple filter rows and toggle between AND (every condition must match) and OR (any condition matches) to narrow or broaden the filtered results — for example role equals admin AND city contains Delhi.
5 JSON Formatter Tips for Faster API Debugging
Practical JSON formatting habits that reduce debugging time when working with API responses and logs.
How to Format JSON in JavaScript
A practical guide to formatting, validating, and safely pretty-printing JSON in modern JavaScript apps.
JSON vs XML — Which Should You Use?
A practical comparison of JSON and XML for APIs, integration workflows, and long-term maintainability.
Top 5 Free Online JSON Formatters Compared
A feature-by-feature comparison of five popular free JSON formatters, with a practical ranking for developer workflows.