JSON Formatter, Validator & Converter

Beautify, validate, minify, sort, escape and convert JSON to CSV. Everything runs locally in your browser.

Free · Instant · 100% Local
Quick answer: JSON (JavaScript Object Notation) is a text format for structured data made of objects, arrays, strings, numbers, booleans and null. To fix a broken file, paste it below and check the exact line and column of the first syntax error. To make it readable, choose an indent and click Beautify. To shrink it for an API request, click Minify. Keys must use double quotes, trailing commas and comments are not allowed.
Waiting for input. Paste JSON above, or click Load sample to try the tool.
Privacy first: your JSON is parsed with the browser's built-in parser. No request is made, no data is uploaded, and nothing is saved after you leave the page. You can even disconnect from the internet and the tool will keep working.

What Is JSON?

JSON stands for JavaScript Object Notation. It is a lightweight, language-independent text format for representing structured data, standardised in RFC 8259 and ECMA-404. Despite its name, JSON is used by virtually every programming language and is the dominant format for web APIs, configuration files, NoSQL documents and data exports.

A JSON document is built from six value types. Objects are unordered collections of key-value pairs wrapped in braces, arrays are ordered lists wrapped in brackets, and the remaining types are strings, numbers, booleans and null. Because the grammar is small and strict, parsers are fast and unambiguous.

JSON Syntax at a Glance

ElementSyntaxRules to remember
Object{"key": "value"}Keys must be strings in double quotes. Key order is not significant.
Array[1, 2, 3]Elements are ordered and may be of mixed types.
String"hello\nworld"Double quotes only. Escape quotes, backslashes and control characters.
Number-12.5e3No leading plus, no leading zeros, no NaN or Infinity, no hexadecimal.
Booleantrue / falseLowercase only.
NullnullLowercase only. Undefined is not a JSON value.
Separator, and :No trailing comma before a closing brace or bracket.
Whitespacespace, tab, LF, CRAllowed between tokens only, not inside the grammar of a number.

Common JSON Errors and How to Fix Them

MistakeWhy it failsFix
Trailing comma: {"a":1,}A comma must be followed by another member.Delete the last comma.
Single quotes: {'a': 1}Only double quotes are valid for strings and keys.Replace with double quotes.
Unquoted keys: {a: 1}Object keys must be JSON strings.Wrap every key in double quotes.
Comments: // noteStandard JSON has no comment syntax.Remove comments or use a JSONC/JSON5 parser.
undefined, NaN, InfinityThese are not JSON value types.Use null or a string such as "NaN".
Unescaped newline inside a stringControl characters are forbidden in string literals.Use \n or close and reopen the string.
Mismatched bracesEvery opening brace or bracket needs a matching closer.Check nesting, then beautify to see the structure.
Duplicate keysSyntactically valid, but the last value wins in most parsers.Remove duplicates to avoid silent data loss.

Formatting vs. Minifying

Both operations produce documents that parse to exactly the same data. Beautifying inserts indentation and line breaks so that a human can read nested structures; minifying strips all optional whitespace to reduce payload size for network transfer. A minified response is usually 15 to 40 percent smaller, while a formatted one is far easier to review in a code editor or to paste into documentation. Never minify by hand, because deleting whitespace inside a string changes the data.

How the JSON to CSV Converter Handles Nested Data

CSV is a flat, two-dimensional format, while JSON can be deeply nested. This tool flattens nested objects into dot-notation headers. For example:

{"id": 1, "user": {"name": "Ada", "city": "London"}}
becomes columns: id, user.name, user.city

The converter takes the union of all keys across every record, so records with missing fields simply get empty cells. Arrays are kept as JSON text inside a single cell rather than being silently discarded. Values containing commas, quotes or line breaks are quoted according to RFC 4180, with internal quotes doubled. The result opens cleanly in Excel, Google Sheets, LibreOffice and most databases.

JSON vs. CSV: Which Should You Use?

CriterionJSONCSV
Nested dataNative support for objects and arraysRequires flattening
Data typesString, number, boolean, null, array, objectEverything is text; types are inferred
Human readabilityGood when formattedExcellent for table-shaped data
File sizeLarger because of repeated keysSmaller for uniform rows
Best forAPIs, configs, documents, logsSpreadsheets, analytics imports, bulk tables

Key Takeaways

  • Valid JSON uses double quotes, has no comments and never ends a list with a comma.
  • Beautifying and minifying change only whitespace, never the underlying data.
  • Sorting object keys is safe because key order has no meaning in JSON; array order does.
  • Converting nested JSON to CSV requires flattening, and arrays must be preserved explicitly.
  • Client-side processing means sensitive payloads never leave your device.

Last updated: December 1, 2026 · Reference: RFC 8259 (The JavaScript Object Notation Data Interchange Format).

JSON Formatter FAQ

What is JSON?

JSON stands for JavaScript Object Notation. It is a language-independent text format for structured data built from objects, arrays, strings, numbers, booleans and null. It is defined by RFC 8259 and ECMA-404.

How do I check whether JSON is valid?

Parse it with a JSON parser. A valid document has double-quoted keys and string values, no trailing commas, no comments, no single quotes, and no undefined or NaN values. A validator reports the exact position of the first syntax error.

Why does my JSON have a trailing comma error?

The JSON specification does not allow a comma after the final element of an object or array. Remove the last comma before the closing brace or bracket.

Can JSON contain comments?

No. Standard JSON has no comment syntax. Formats such as JSONC and JSON5 allow comments, but a strict JSON parser will reject them.

What is the difference between formatting and minifying JSON?

Formatting adds indentation and line breaks to make JSON readable for humans. Minifying removes all optional whitespace to reduce file size for transmission. Both preserve exactly the same data.

How do I convert nested JSON to CSV?

Flatten nested objects into dot-notation column names such as address.city, collect the union of all keys across records, and write one row per object. Arrays are preserved as JSON text inside a single cell.

Is my JSON data uploaded anywhere?

No. All parsing, formatting and conversion happen locally in your browser using JavaScript. Nothing is sent to a server, stored, or logged.

Does sorting keys change the meaning of my JSON?

No. Object key order is not significant in JSON, so sorting keys alphabetically produces an equivalent document. Array element order is significant and is never changed.