Toolkernel
  • CSV
  • JSON
  • Regex
  • PDF
  • JWT
  • YAML
  • Cron
Toolkernel

Free, privacy-focused developer tools that run entirely in your browser.

  • ✓ 100% browser-based
  • ✓ No data uploaded
  • ✓ Free forever

JSON & CSV

  • JSON Formatter
  • JSON Compare
  • JSON Auto-Fix
  • CSV Cleaner & Merger
  • YAML Formatter

PDF Tools

  • Merge PDF
  • Split PDF
  • Compress PDF
  • PDF to Images
  • All PDF Tools

More Tools

  • Regex Tester
  • JWT Decoder
  • Cron Builder

© 2026 Toolkernel. All rights reserved.

Your files never leave your device. Built for developers who value privacy.

  1. Toolkernel
  2. /
  3. JSON Tools
Your data never leaves your device

Format & ValidateJSON Instantly

Beautify minified JSON, validate syntax, compare two JSONs side-by-side, and minify for production. All processing happens in your browser—fast, private, and free.

JSON Formatter

Format, beautify, validate & minify JSON with syntax highlighting

Compare JSON

Side-by-side diff with smart detection for objects and arrays

Auto-Fix JSON

Repair trailing commas, missing quotes, and common errors

Format & Beautify
Validate Syntax
Compare JSONs
Minify JSON
100%
Browser-based
0
Data uploaded
∞
Files processed

Complete JSON Formatter Guide

A powerful browser-based tool for formatting, validating, and transforming JSON data. Includes auto-fix, TypeScript generation, and advanced tools. All processing happens locally in your browser—your data never leaves your device.

✨Format & beautify
✅Validate syntax
🔧Auto-fix errors
📦Minify output
🔍Search & compare
📘Generate TypeScript
Open JSON EditorTry CSV Tools

Editor Interface

The JSON Editor features a clean two-panel layout with a control bar for all operations. Input on the left, output on the right, controls at the top.

1

Input Panel

The left panel is where you enter your JSON data. You can paste JSON directly, type it manually, or load a sample to get started. The input supports any valid JSON including objects, arrays, and nested structures.

How to Use

  • Paste your JSON data directly into the text area
  • Use 'Load Sample' to see an example of properly formatted JSON
  • The input accepts both minified and formatted JSON
  • Large JSON files are supported - processing happens entirely in your browser
2

Output Panel

The right panel displays the processed result after you format, beautify, or minify your JSON. The output is read-only and includes options to copy to clipboard or download as a file.

How to Use

  • View the formatted or minified result after processing
  • Click 'Copy' to copy the output to your clipboard
  • Click 'Download' to save the result as a .json file
  • Toggle between formatted and original views to compare changes
3

Action Controls

The control bar provides quick access to all JSON operations. Configure indentation settings, format or minify your JSON, access the powerful Tools dropdown, and use utility functions like clear and sample loading.

How to Use

  • Select indentation size (2, 4, or 8 spaces) before formatting
  • Click 'Format / Beautify' to add proper indentation and line breaks
  • Click 'Minify' to remove all whitespace for compact output
  • Open the 'Tools' dropdown for advanced features like sort, flatten, compare, and more
  • Use 'Clear' to reset both input and output panels

100% Private & Secure

Your JSON data never leaves your browser. Unlike many online tools that upload your data to remote servers, we process everything locally using JavaScript.

No file uploads to any server – all processing happens in your browser
Your JSON data never leaves your computer
Perfect for sensitive configuration files, API keys, or personal data
Works offline once the page is loaded – no internet required
No account or registration required – start using immediately

Feature Reference

Detailed documentation for all available features. Click to expand each section.

Transform minified or messy JSON into clean, readable code with proper indentation. Formatting makes JSON easy to read, debug, and understand at a glance.

Pretty Print with Indentation

Adds consistent indentation and line breaks to make JSON human-readable. Choose from 2, 4, or 8 space indentation to match your project's style guidelines.

Example{"name":"John","age":30} → { "name": "John", "age": 30 }
WhenWhen you receive minified JSON from an API, copy JSON from logs, or need to review JSON structure.

Nested Structure Visualization

Proper indentation clearly shows the nesting level of objects and arrays. Each level is indented consistently, making parent-child relationships obvious.

ExampleDeeply nested objects show clear visual hierarchy through indentation
WhenWhen working with complex JSON containing multiple levels of nesting, like API responses or configuration files.

Instantly check if your JSON is valid and get detailed error messages with line numbers when something is wrong. Catch syntax errors before they cause problems in your application.

Real-time Syntax Validation

When you click Format or Minify, the tool automatically validates your JSON. Invalid JSON displays a clear error message explaining what went wrong and where.

ExampleMissing comma on line 5 → 'Invalid JSON: Unexpected token } at position 45'
WhenEvery time you process JSON. Validation happens automatically with every format/minify operation.

Error Position Reporting

When JSON is invalid, the error message includes the position where parsing failed. This helps you quickly locate and fix the problem in your source data.

Example'Unexpected token at position 127' points to the exact character causing the issue
WhenWhen debugging malformed JSON received from external sources or after manual editing.

Common Error Detection

Detects common JSON mistakes: trailing commas, missing quotes around keys, single quotes instead of double quotes, unescaped special characters, and mismatched brackets.

Example{name: 'John'} → Error: Keys must be quoted, use double quotes not single
WhenWhen converting from JavaScript object notation to valid JSON, or cleaning up hand-written JSON.

Powered by the robust jsonrepair library, our tool can automatically fix a wide range of JSON errors. When invalid JSON is detected, the tool analyzes and repairs it with one click.

One-Click JSON Repair

When your JSON has errors, the tool uses advanced parsing to automatically fix issues. Works with complex, nested JSON of any size. If repairs are possible, a 'Fix JSON' button appears with a summary of changes.

Example{name: 'John', age: 30,} → Click 'Fix JSON' → {"name": "John", "age": 30}
WhenWhen you have malformed JSON from copy-paste errors, JavaScript object notation, API responses, or data from Python/other languages.

Quote Handling

Converts single quotes to double quotes, adds missing quotes around keys, and properly escapes quotes within strings. Handles complex nested strings correctly.

Example{'name': 'O\'Brien'} → {"name": "O'Brien"}
WhenWhen copying data from Python, JavaScript, or other languages that use different quoting conventions.

Comma & Bracket Fixes

Removes trailing commas, adds missing commas between elements, and fixes mismatched or missing brackets. Handles deeply nested structures.

Example{"a": 1 "b": 2} → {"a": 1, "b": 2}
WhenWhen JSON was manually edited and has structural errors, or when copying from logs that may be truncated.

Comment Removal

Strips JavaScript-style comments (// line comments and /* block comments */) from the JSON. Handles comments anywhere in the structure.

Example{"debug": true /* for testing */} → {"debug": true}
WhenWhen working with JSON5, JSONC (JSON with Comments), or configuration files that include comments.

Language Value Conversion

Converts values from other languages: Python (True, False, None), JavaScript (undefined, NaN, Infinity), and unquoted strings to valid JSON equivalents.

Example{"active": True, "count": NaN} → {"active": true, "count": null}
WhenWhen pasting data from Python scripts, JavaScript console output, or other programming language outputs.

Special Format Handling

Handles JSONP notation (callback wrapping), concatenated JSON objects, MongoDB-style data, and other special formats that contain valid JSON within.

Examplecallback({"data": 123}) → {"data": 123}
WhenWhen extracting JSON from API responses wrapped in callbacks, or from log files with extra formatting.

Remove all unnecessary whitespace from your JSON to reduce file size. Minified JSON is ideal for production use, API payloads, and storage optimization.

Whitespace Removal

Strips all spaces, tabs, and line breaks from your JSON while keeping it valid. The result is a single-line, compact representation perfect for transmission.

Example{ "name": "John", "age": 30 } → {"name":"John","age":30}
WhenBefore sending JSON over network requests, storing in databases, or embedding in code.

Size Reduction

Minification typically reduces JSON file size by 10-30% depending on the original formatting. For large JSON files, this can significantly reduce bandwidth and storage costs.

ExampleA 10KB formatted JSON might become 7KB after minification
WhenWhen optimizing API responses, reducing payload sizes, or preparing JSON for production deployment.

Powerful transformation tools to manipulate your JSON structure. Sort keys, remove unwanted values, flatten nested structures, and more.

Sort Keys Alphabetically

Recursively sorts all object keys in alphabetical order throughout the entire JSON structure. Makes JSON easier to compare and navigate, especially for configuration files.

Example{"zebra": 1, "apple": 2} → {"apple": 2, "zebra": 1}
WhenWhen you need consistent ordering for version control, configuration management, or easier visual comparison.

Remove Null Values

Recursively removes all null values from objects and arrays. Helps clean up JSON data by eliminating empty or undefined fields.

Example{"name": "John", "age": null} → {"name": "John"}
WhenWhen preparing data for APIs that don't accept null values, or cleaning up database exports.

Remove Empty Values

Removes null values, empty strings (""), empty arrays ([]), and empty objects ({}) recursively. Provides thorough cleanup of sparse data.

Example{"name": "", "tags": [], "meta": {}} → {}
WhenWhen you need to strip all empty/falsy values from JSON data before processing or storage.

Flatten Nested JSON

Converts nested JSON structures into a flat object with dot-notation keys. Array indices are preserved as [0], [1], etc.

Example{"user": {"name": "John"}} → {"user.name": "John"}
WhenWhen importing data to flat databases, creating CSV exports, or debugging deeply nested structures.

Unflatten to Nested

Converts a flat object with dot-notation keys back into a nested JSON structure. The reverse of the flatten operation.

Example{"user.name": "John"} → {"user": {"name": "John"}}
WhenWhen reconstructing nested JSON from flattened data, like CSV imports or database exports.

Convert JSON to and from various encoded formats. Handle escaped strings, URL-encoded data, and Base64 encoding commonly encountered in web development.

Escape for String Embedding

Converts your JSON into an escaped string that can be safely embedded in code. Wraps the minified JSON in quotes with all internal quotes escaped.

Example{"name": "John"} → "\"{\\"name\\": \\"John\\"}\""
WhenWhen you need to embed JSON as a string value in code, environment variables, or other JSON.

Unescape String

Converts an escaped JSON string back into formatted JSON. Parses the outer string and then formats the inner JSON.

Example"\"{\\"name\\": \\"John\\"}\"" → {"name": "John"}
WhenWhen extracting JSON from string literals, environment variables, or double-encoded data.

URL Decode

Decodes URL-encoded (percent-encoded) JSON strings. Handles %20, %22, %7B and other URL escape sequences.

Example%7B%22name%22%3A%22John%22%7D → {"name": "John"}
WhenWhen extracting JSON from URL query parameters, form data, or URL-encoded API responses.

Base64 Decode

Decodes Base64-encoded JSON strings. Commonly used for JWT payloads, API tokens, and encoded data transfer.

ExampleeyJuYW1lIjoiSm9obiJ9 → {"name": "John"}
WhenWhen decoding JWT tokens, inspecting Base64-encoded API responses, or extracting embedded data.

Generate code from your JSON data. Convert JSON structures into TypeScript interfaces and other code formats for use in your applications.

Generate TypeScript Interfaces

Automatically creates TypeScript interface definitions from your JSON structure. Infers types for all properties and handles nested objects and arrays.

Example{"name": "John", "age": 30} → interface Root { name: string; age: number; }
WhenWhen building TypeScript applications and need type definitions for API responses or data structures.

Find specific data within large JSON structures and compare two JSON documents to identify differences. Essential tools for debugging and data analysis.

Search in JSON

Search for keys or values within your JSON data. Results show the JSONPath to each match, making it easy to locate data in complex structures.

ExampleSearch 'email' → user.contact.email → john@example.com
WhenWhen working with large JSON files and need to find specific fields or values quickly.

Compare Two JSONs

Side-by-side comparison of two JSON documents. Shows added, removed, and changed values with color-coded diff output. Perfect for tracking changes.

ExampleOriginal: {"a": 1} vs Modified: {"a": 2, "b": 3} → CHANGED: a (1 → 2), ADDED: b
WhenWhen comparing API responses, tracking configuration changes, or debugging data transformation issues.

Easily copy your processed JSON to the clipboard or download it as a file. Multiple export options ensure you can use your JSON anywhere.

Copy to Clipboard

One-click copy of the entire output to your clipboard. The button shows confirmation when the copy is successful so you know it worked.

ExampleClick 'Copy' → '✓ Copied!' confirmation appears
WhenWhen you need to paste the JSON into another application, editor, or form.

Download as File

Downloads the output as a .json file with the name 'formatted.json'. The file is created locally in your browser - no server upload required.

ExampleClick 'Download' → 'formatted.json' saves to your downloads folder
WhenWhen you need to save the processed JSON for later use, share it with others, or store it as part of a project.

Our JSON tools are designed for a wide range of use cases. Here are common scenarios where our formatter and validator can help.

🔧

API Development

Format API responses for debugging, validate request payloads before sending, and minify JSON for production deployments.

  • Debug REST API responses by formatting the JSON output
  • Validate webhook payloads before processing
  • Minify configuration JSON for deployment
  • Generate TypeScript interfaces from API responses
🐛

Debugging & Troubleshooting

Quickly format JSON from logs, error messages, or console output to understand the data structure and identify issues.

  • Format JSON error responses from servers
  • Parse and read log files containing JSON data
  • Compare API responses to find differences
  • Search for specific keys in large JSON structures
💾

Data Preparation

Clean and format JSON data before importing into databases, converting to other formats, or using in applications.

  • Remove null values before database import
  • Flatten nested JSON for CSV export
  • Sort keys for consistent configuration files
  • Decode Base64 or URL-encoded JSON data
📚

Learning & Documentation

Format JSON examples for documentation, tutorials, or learning materials. Clear formatting helps others understand the data structure.

  • Create readable examples for API documentation
  • Generate TypeScript types for documentation
  • Compare before/after examples to show changes
🔐

Security & Token Analysis

Decode and analyze JWT tokens, Base64-encoded payloads, and URL-encoded data to understand authentication and authorization flows.

  • Decode JWT payload to inspect claims
  • Decode Base64-encoded API responses
  • Unescape JSON from environment variables
  • URL decode query parameters containing JSON
⚖️

Version Control & Diffing

Compare JSON configurations, track changes between versions, and ensure consistent ordering for reliable diffs.

  • Compare two versions of a config file
  • Sort keys for cleaner git diffs
  • Identify changes between API response versions
  • Track configuration drift across environments

JSON has strict syntax rules that differ from JavaScript. Understanding these rules will help you avoid common errors.

Keys Must Be Quoted

Correct
{"name": "John"}
Incorrect
{name: 'John'}

All keys in JSON must be strings enclosed in double quotes. JavaScript allows unquoted keys, but JSON does not.

Use Double Quotes Only

Correct
{"city": "New York"}
Incorrect
{'city': 'New York'}

JSON requires double quotes (") for all strings. Single quotes (') are not valid in JSON.

No Trailing Commas

Correct
{"a": 1, "b": 2}
Incorrect
{"a": 1, "b": 2,}

Unlike JavaScript, JSON does not allow trailing commas after the last element in objects or arrays.

No Comments Allowed

Correct
{"debug": true}
Incorrect
{"debug": true} // enable debug mode

JSON does not support comments of any kind. Remove all // and /* */ comments before parsing.

Valid Data Types

Correct
{"count": 42, "active": true, "data": null}
Incorrect
{"count": undefined, "date": new Date()}

JSON supports: strings, numbers, booleans, null, arrays, and objects. No undefined, functions, or JavaScript constructors.

Related Developer Tools

✨

JSON Formatter

Format and beautify JSON with customizable indentation.

Open Editor
🔧

JSON Auto-Fix

Automatically repair invalid JSON errors with one click.

Fix JSON
⚖️

JSON Compare

Compare two JSON files with semantic diff detection.

Compare JSONs
📊

CSV Tools

Clean, merge, and transform CSV files with ease.

Try CSV Tools