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 you can 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.

Capabilities

What You Get

Pretty-print, validate, minify, and diff — the everyday JSON operations in one pass, with no payload leaving the tab.

Pretty Printing

Turns minified single-line API responses into indented, readable, highlighted JSON.

Inline Validation

Invalid JSON reports the exact syntax problem and where it occurs.

Minify Mode

Strips all whitespace to the most compact representation for smaller payloads.

Side-By-Side Diff

Paste two objects and see changed lines highlighted between A and B.

One-Click Copy

Copy formatted or minified output straight to the clipboard.

Nothing Transmitted

Parsing happens in your browser — safe for tokens, payloads, and internal APIs.

Related tools.

More free browser-based utilities, connected by category and use case.

All Tools

FAQ

JSON Formatter & Diff FAQ.

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.