August 24, 2026 · Developer Tools
What Is JSON? How to Format and Validate JSON
JSON is behind countless API responses, configuration files, and data exports. This guide explains the structure in plain language, shows why formatting helps, and provides a reliable way to diagnose syntax errors without treating the data as executable code.
What JSON Is Designed to Do
JSON—JavaScript Object Notation—is a text representation of structured data. The name reflects its origins, but JSON is not limited to JavaScript. Nearly every mainstream programming language can read and write it. Files often use a .json extension, while web responses commonly identify it with the application/json media type.
JSON is data, not a program. It has no functions, variable declarations, or standard comment syntax. A safe workflow therefore parses JSON as data instead of evaluating it as source code.
Objects, Arrays, Keys, and Values
An object is enclosed by braces, and an array is enclosed by brackets. Every property name in an object uses double quotes, followed by a colon and its value. A value may be a string, number, Boolean, null, another object, or an array.
{
"product": "Notebook",
"price": 12.5,
"inStock": true,
"tags": ["paper", "office"],
"supplier": {
"city": "Leeds"
}
}
Commas separate items at the same level, but there is no comma after the final item. Property order is not normally a dependable source of meaning. If an application relies on order, that requirement should be explicit.
Why Format JSON?
JSON is often transferred on a single line with insignificant whitespace removed. That minified form is compact, but it is difficult to inspect once objects and arrays become nested. Formatting adds indentation and line breaks while preserving the parsed keys and values, making hierarchy visible to a reader.
Two-space indentation is compact, while four spaces create more visual separation. Either can be valid; consistency with the project or team convention matters more than the number itself.
What Validation Proves—and What It Does Not
Syntax validation proves that a parser can read the JSON. It does not prove that the data makes sense for your application. For example, {"age":-3} is valid JSON even though the value is probably unacceptable for an age field. Required properties, allowed values, and field types need a schema or application-level checks.
Trailing commas
{"name":"Ada",} may resemble JavaScript, but the final comma is not valid JSON.
The wrong quotation marks
Keys and string values require straight double quotes, not single quotes or typographic quotes pasted from a document.
Missing delimiters and escaping
Every opening brace or bracket must close, and a double quote inside a string must be escaped as \".
A Dependable Format-and-Validate Workflow
- Confirm the source really returned JSON rather than an HTML error page or a plain-text message.
- Paste the text into a JSON validator and run a syntax check first.
- If a position is reported, also inspect the comma, quote, or bracket immediately before it; a parser can notice the failure after the true mistake begins.
- Format valid input with two or four spaces. Minify it again only when a compact transfer or storage form is useful.
- Check the actual fields and values against the expectations of the consuming application.
Privacy When Using an Online JSON Tool
JSON can contain API keys, access tokens, customer details, or internal configuration. Check whether a tool uploads the input for processing before pasting sensitive material. The RizeTab formatter parses input on the page with JSON.parse() and does not call a third-party processing API. Replacing secrets with sample values is still good practice, and local risks such as clipboard history and browser extensions remain relevant.
Check Your JSON Now
Validate the syntax, turn minified data into a readable structure, or produce a compact result directly in your browser.
Open JSON Formatter & Validator → All Tools →