all tools
DEVELOPER

JSON Formatter & Diff

Format, validate, minify, and diff JSON. All in your browser.

Indent:
Input JSON✓ Valid
Formatted
:#ffd700">{
  :#9cdcfe">"name": :#ce9178">"John Doe",
  :#9cdcfe">"age": :#b5cea8">30,
  :#9cdcfe">"active": :#569cd6">true,
  :#9cdcfe">"tags": :#ffd700">[
    :#ce9178">"developer",
    :#ce9178">"designer"
  :#ffd700">],
  :#9cdcfe">"address": :#569cd6">null
:#ffd700">}

What Can You Do with This Tool?

This JSON tool covers the three most common tasks when working with JSON data. The formatter (Pretty mode) takes any valid JSON — even minified, single-line API responses — and returns it as properly indented, readable text with syntax highlighting. Minify mode does the reverse. Diff mode makes it easy to compare two API responses and immediately see what fields changed.

Frequently Asked Questions

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, human-readable data interchange format. It represents data as key-value pairs (objects) and ordered lists (arrays). JSON is the dominant format for web APIs, configuration files, and data storage because it's easy to parse in virtually every programming language.

How do I validate JSON?

Paste your JSON into the input area. The formatter shows 'Valid' in green or an error message in red pointing to the exact syntax problem. Valid JSON must have properly quoted strings, correct comma placement, no trailing commas, and matching brackets/braces.

What is JSON minification?

Minification removes all unnecessary whitespace (spaces, newlines, indentation) from JSON, reducing file size without changing the data. Switch to 'Minify' mode to get the most compact possible representation — useful for reducing payload sizes in API responses.

What does the diff mode do?

Diff mode lets you paste two JSON objects and see them side by side with changed lines highlighted. Lines that differ between A and B are highlighted in red (A) and green (B), making it easy to spot what changed between two API responses or config versions.

Why do I get 'SyntaxError: Unexpected token' in JSON?

Common causes: trailing commas after the last item (not allowed in JSON, though allowed in JavaScript), single-quoted strings (JSON requires double quotes), undefined or unquoted values, or a missing closing bracket/brace. The error message will indicate the position in the string.

Is there a size limit for JSON I can format?

There's no enforced limit — the tool processes everything in your browser's JavaScript engine. Very large JSON objects (10MB+) may be slow to format depending on your device. For smaller JSONs, formatting is instant.

More developer tools

JWT decoder, regex tester, SQL formatter, Base64 encoder and more.

Browse all tools