Format, validate and minify JSON, JSONC or JSON5 as you paste, with exact numbers, precise error locations, a tree view, JSONPath queries and schema checks.
Initializing in your browser…
Format, minify or convert XML to JSON as you type, with line-and-column error checks, a tree view and XPath queries that handle namespaces.
Format and validate YAML or convert between YAML and JSON as you type, keeping comments, anchors and exact numbers, with YAML 1.1 and 1.2 support.
Generate a JSON Schema (draft 2020-12 or draft-07) from a JSON document as you paste, with detected formats and a check that your document validates.
An API returned a single minified line with an order identifier and a price, and you need to read it before filing a bug about a wrong order number.
Minified response
{"orderId":12345678901234567890,"price":19.90,"active":true}Formatted, values unchanged
{
"orderId": 12345678901234567890,
"price": 19.90,
"active": true
}
line 1:12 12345678901234567890 is kept exactly as written. A program that
reads it as a standard double gets 12345678901234567000,
a different number.
line 1:41 19.90 is kept exactly as written. Tools that convert numbers
to doubles would write it as 19.9.The output differs from the input only in whitespace. The two notes explain the bug you may be chasing: the ID has 20 digits, more than a 64-bit float can hold exactly, so any service that parses it with a standard JSON library will see 12345678901234567000 and look up the wrong order. The price note is harmless (19.90 and 19.9 are the same value) but explains why a re-serialised copy looks different. Sending large IDs as strings avoids the problem.
Paste JSON to format, validate or minify it instantly, with clear error messages that point to the exact line and column. Explore the result as a tree, run JSONPath queries, compare two documents and check them against a JSON Schema, all in your browser and without changing a single value.
JSON is easy to read once it is indented and nearly impossible when an API returns it as one long line. This formatter lays it out as soon as you paste, colours keys, strings and numbers, and tells you immediately whether the document is valid. When it is not, you get the line, the column, the offending line with a caret under the problem and a plain description of what went wrong, such as a missing comma or a closing bracket of the wrong kind.
Nothing changes but the whitespace. Many online formatters run the text through JSON.parse and JSON.stringify, which converts every number to a 64-bit float. That quietly turns an order ID like 12345678901234567890 into 12345678901234567000 and writes 19.90 as 19.9. This tool keeps the exact text of every number, string and key, so the formatted output is the same data with new spacing. If a number would be altered by a typical JSON library, a note says so, which is useful when you are chasing a bug where an ID changes between systems.
JSON with comments and JSON5. Configuration files such as tsconfig.json and VS Code settings allow comments and trailing commas, and JSON5 adds unquoted keys, single quotes, hexadecimal numbers and Infinity. Choose the dialect under Read as and the tool reads them correctly. The output is always standard JSON; any value that standard JSON cannot write the same way (for example 0xFF or a leading plus sign) is listed with what it became and why.
Repeated keys and key order. The JSON standard says keys should be unique but does not forbid repeats, and most parsers silently keep only the last one. The formatter points out every repeated key and lets you keep them all, keep the first or keep the last. Keys can stay in their original order or be sorted, either by Unicode code point for stable diffs or by the rules of your language.
Tree, query, compare and schema. The Tree view lets you fold and unfold large structures. The Query view runs JSONPath expressions such as $.items[*].sku or $..price, with suggestions built from your document, and shows results with the original digits intact. Compare lists every key that was added, removed or changed between your document and a second version, ignoring formatting. The schema check validates the document against a JSON Schema covering type, required, properties, additionalProperties, items, enum, minimum, maximum, minLength and maxLength, and names any keyword it does not check. Everything runs locally; documents up to about 400 KB format as you type, and larger files format when you press the button.
Paste a minified response from a browser network tab or a log and read it as an indented, coloured document, then pull out the fields you need with a JSONPath query.
Find the missing comma or stray bracket in a package.json, tsconfig.json or settings file from the exact line and column of the error.
Validate a request or response body against its JSON Schema before sending it, and see each failing field by path.
Compare yesterday's and today's export key by key, without the noise of formatting differences.
{"orderId":12345678901234567890,"price":19.90} formats to two indented lines that still read 12345678901234567890 and 19.90. A note explains that a standard JavaScript parser would read the ID as 12345678901234567000.
A tsconfig.json with // comments and a trailing comma fails as plain JSON with the line and column of the first comment. Switch Read as to JSON with comments and it formats cleanly.
On {"items":[{"sku":"a-1","qty":2},{"sku":"b-2","qty":5}]} the query $.items[?(@.qty > 3)].sku returns ["b-2"].
The most common causes are a missing or extra comma, single quotes instead of double quotes, unquoted keys, comments, or a trailing comma after the last item. The error panel shows the line and column with a caret at the problem. If the file is a configuration file that allows comments, choose JSON with comments or JSON5 under Read as.
No. Each number is written back exactly as it appears in your document, including large integers and trailing zeros. Many formatters convert numbers to floating point, which can change IDs longer than about 15 digits; this one does not.
JSON is the strict standard (RFC 8259). JSON with comments adds // and /* */ comments and trailing commas, as used by VS Code and TypeScript config files. JSON5 also allows unquoted keys, single-quoted strings, hexadecimal numbers, Infinity and NaN. The output is always standard JSON.
They are reported with their line and column. By default every copy is kept so nothing disappears; choose Keep the first or Keep the last under Repeated keys to remove the extras. Most JSON libraries keep only the last value without warning.
The common Goessner syntax: $ for the root, .name and ['name'] for keys, [0] and [-1] for indexes, [0:3] slices, [0,2] lists, [*] and .* wildcards, ..name for recursive search and filters such as [?(@.price > 10)] or [?(@.status == "active")].
Documents up to about 400 KB update as you type. Larger files format when you press Format now, so typing stays responsive. The practical limit is your browser's memory, since nothing is uploaded.
No. Parsing, formatting, queries, comparison and schema checks all run in your browser. The share link stores only your settings, never the document.
Your text is processed locally in the browser. Nothing you paste or open is transmitted or logged.