JSON Format Examples & Templates
Browse common JSON format examples and templates. Copy any example directly into the formatter above to experiment with formatting, validation, and minification.
API response example
A typical REST API response wraps data in a standard envelope with status, data, and metadata fields. This pattern separates the payload from pagination info and provides a consistent structure for clients. Most frameworks like Express, FastAPI, and Spring Boot follow this convention.
{
"status": "success",
"data": {
"id": 1,
"name": "John Doe",
"email": "john@example.com",
"roles": ["admin", "user"]
},
"meta": {
"page": 1,
"total": 42,
"per_page": 20
}
}Configuration file example
JSON is widely used for configuration: package.json (Node.js), tsconfig.json (TypeScript), .eslintrc.json (ESLint), and settings.json (VS Code). These files typically use nested objects with string, number, boolean, and array values to define application behavior. Paste any config file into the formatter above to validate and beautify it.
// package.json — minimal Node.js project
{
"name": "my-app",
"version": "1.0.0",
"type": "module",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"next": "^16.0.0",
"react": "^19.0.0"
}
}Nested data structures
JSON supports arbitrary nesting of objects and arrays. Common patterns include arrays of objects (database rows), nested objects (hierarchical data), and mixed structures (API responses with pagination). The formatter handles any nesting depth with proper indentation.
// Array of objects — common database/API pattern
[
{ "id": 1, "name": "Alice", "tags": ["admin"] },
{ "id": 2, "name": "Bob", "tags": ["user", "editor"] }
]
// Nested hierarchy — org chart, menu, file tree
{
"name": "Engineering",
"children": [
{ "name": "Frontend", "children": [] },
{ "name": "Backend", "children": [] }
]
}Frequently Asked Questions
What data types does JSON support?
JSON supports six data types: strings (double-quoted), numbers (integer or floating-point), booleans (true/false), null, objects (key-value pairs), and arrays (ordered lists).
What is the maximum size of a JSON file?
JSON has no specification-defined size limit. Practical limits depend on the parser and available memory. Most APIs limit request bodies to 1–10 MB. This browser-based tool handles files up to several megabytes comfortably.
Related Format Tools
Code Minifier & Beautifier
Minify and beautify JavaScript, CSS, and HTML code instantly
YAML Formatter
Validate, format, beautify, and minify YAML documents instantly
SVG Optimizer
Optimize SVGs by removing metadata, comments, editor data, and unnecessary attributes
Markdown Preview
Write and preview Markdown with live rendering