.json file format

Free JSON Tools

View, format, validate, merge, convert, clean, and test JSON data directly in your browser.

Format

JSON

.json

Original files stay unchanged. Tools download a new file when output is generated.

Popular JSON Tools

Every tool listed here works with .json files and runs in your browser. If the task you need is not here, the related formats below may cover it.

JSON is stricter than it looks

Most invalid JSON fails on one of a handful of rules. Trailing commas after the last item are not allowed. Strings must use double quotes, never single. Comments are not part of the format. Keys must be quoted strings. NaN and Infinity are not valid values. JavaScript object literals permit several of these, which is exactly why hand-edited JSON breaks.

Where a validator earns its keep

A parse error reports a position, not an explanation. Pasting a large payload into a validator gets you to the offending character quickly, and formatting it with consistent indentation usually makes the structural mistake — a missing brace, a nesting level deeper than intended — visible at a glance.

JSON, JSONL, and tabular data

An API that returns a large collection often uses newline-delimited JSON: one complete object per line, no wrapping array. That is JSONL, and it will not parse as a single JSON document. Converting JSON to CSV runs into a different mismatch — JSON nests and CSV does not, so nested objects have to be flattened into columns or dropped.

Testing what happens when JSON is wrong

Code that consumes JSON usually gets tested against well-formed examples. The interesting failures come from the malformed ones: a truncated response, a field that changed type, a null where an object was expected. Deliberately corrupting a known-good payload is a quick way to find out whether your parser fails loudly or silently.

FAQ

Why is my JSON invalid when it looks fine?

Check for a trailing comma, single quotes instead of double, an unescaped quote or backslash inside a string, or a comment. Those five cover the large majority of parse failures.

Are comments allowed in JSON?

No. The specification has no comment syntax. Some parsers accept them as an extension, but a file with comments is not portable JSON.

Does JSON preserve key order?

The format does not guarantee it and consumers should not rely on it, though most parsers and serialisers do preserve insertion order in practice.

What happens to nested objects when I convert JSON to CSV?

They have to be flattened, because CSV is a flat table. Nested keys typically become dotted column names, and arrays of varying length do not map cleanly at all.

Related Resources