---
title: "JSON formatter: pretty-print, minify and validate"
description: "Free JSON formatter and validator. Pretty-print JSON at 2 or 4 spaces or minify it, and see exactly why it fails when it is not valid."
canonical: "https://www.meadowdesk.com/tools/json-formatter"
last_modified: "2026-10-27"
---

# JSON formatter

Source: https://www.meadowdesk.com/tools/json-formatter

Free JSON formatter and validator. Pretty-print JSON at 2 or 4 spaces or minify it, and see exactly why it fails when it is not valid.

Paste JSON to lay it out readably at 2 or 4 spaces, or squeeze it onto one line, and see the parser’s own message when it isn’t valid.

## How to use it

1. Paste your JSON into the input box.
2. Choose 2 spaces or 4 spaces to pretty-print it, or Minify to put it on one line.
3. Check the badge: Valid JSON, or Invalid with the reason in the result box.
4. Copy the formatted result.

## JSON formatter FAQ

**Why is my JSON invalid?**
The usual causes are a comma after the last item, single quotes instead of double quotes, keys without quotes, and comments. All of those are fine in JavaScript but not in JSON. The error message points at the first one the parser hit.

**Is my JSON sent anywhere?**
No. It is read and formatted in your browser and never sent to our server, so API responses, config files and customer data stay on your machine.

**Should I indent with 2 or 4 spaces?**
Follow the project you’re working in. 2 spaces is the most common for JSON on the web and in JavaScript projects, and 4 is common in Python. Minify anything sent over the network or stored, where nobody reads it.

**Can I keep design tokens in JSON?**
Yes, and many design systems do: colors, spacing and type sizes as named values that a build step turns into CSS and app code. Convert each color to the format you need with the [color converter](https://www.meadowdesk.com/tools/color-converter) first.

**How do I make placeholder JSON for a mockup?**
Write one record by hand, copy it a few times and fill the fields: IDs from the [UUID generator](https://www.meadowdesk.com/tools/uuid-generator), text from the [lorem ipsum generator](https://www.meadowdesk.com/tools/lorem-ipsum-generator). Paste the lot here to check it parses before it goes into your prototype.
