Developer tools

JSON Formatter & Validator

Paste in raw or minified JSON to check whether it's valid and get a cleanly indented version, or paste in formatted JSON to compress it down to a single line for use in configuration files or API calls.

Keep a source copy: duplicate keys and large integers can change when JSON is parsed. Syntax validity does not validate your application data.

Format or validate JSON

Compare valid syntax and intended data

Use the sample, then choose Format or Minify. Keep a source copy: parsing can discard duplicate property names and alter integers beyond JavaScript's safe range. A quoted identifier preserves its leading zeros.

Input or checkExpected result or decision
{"id":"001","active":true,"items":[1,null]}The string 001, boolean true, array, and null keep their types.
{"active":true,}Rejected: the final comma is not valid JSON.
{"id":1,"id":2}Parsing keeps the later property; formatting is not a duplicate-key audit.
Minify {"id":1,"id":2}{"id":2}; the earlier duplicate value is discarded.
Minify {"id":9007199254740993}{"id":9007199254740992}; quote the identifier in the source to preserve its digits.

How it works

  • Paste your JSON into the input box.
  • Click format for readable, indented output, or minify for a compact single-line version.
  • Invalid JSON is flagged immediately with a description of what went wrong.

Common uses

  • Cleaning up a minified API response to read it more easily.
  • Checking a hand-written config file for a missing comma or bracket.
  • Compressing a JSON payload before pasting it into a size-limited field.
Your privacy matters here: check the FAQ below for exactly what happens to anything you enter into this tool.

Validate before copying

Try {"name":"Anvil","ready":true}. Formatting changes spacing, while minifying removes unnecessary whitespace. Comments and trailing commas are not valid JSON.

A practical walkthrough

  1. Paste {"name":"Anvil","active":true}, then format it to make its structure easier to inspect.
  2. Check nesting, property names, and data types before copying the result into a configuration file.
  3. Use Copy to copy the formatted or minified JSON. Keep the original if duplicate keys or large numeric identifiers matter.

Tips for a reliable result

JSON requires quoted property names and does not allow trailing commas or comments. Formatting cannot determine whether values are correct for your application.

What to use next

These tools open separately; inputs are not transferred.

Developer tools

CSV to JSON Converter

Convert quoted CSV data into JSON arrays or objects locally.

Open tool →
Developer tools

JWT Decoder

Inspect a JWT header and payload without uploading the token.

Open tool →
Text tools

Text Difference Checker

Compare two texts line by line and highlight additions and removals.

Open tool →
Developer tools

Base64 Encoder & Decoder

Convert text to Base64 and back, entirely in your browser.

Open tool →

How this tool handles your data

JSON is parsed and formatted in your browser and is not sent to an Anvil processing server.

Compare privacy behavior across all tools.

Known limitations

Parsing does not validate an API schema. Duplicate object keys collapse, unsafe numeric integers can lose precision, and very large documents may strain browser memory.

Related guide and Lab test

Tool test card

Tested
October 6, 2026
Input types
JSON text
Processing
Runs in this browser
Maximum tested size
14 fixed cases; no general maximum claimed
Observed limitation
Duplicate keys collapse during parsing; unsafe integers can change.
Privacy note
Input stays in the browser.

Read the related reproducible Lab report

Questions and troubleshooting

Is my JSON data sent to a server?

No. Formatting and validation both run entirely in your browser using the JavaScript engine's built-in JSON parser.

What does an 'invalid JSON' error mean?

It means the parser hit something that isn't valid JSON syntax, commonly a trailing comma, an unquoted key, or a missing bracket. The error message names the position where parsing failed.

Does this support JSON5 or JSONC (with comments)?

No, only standard JSON. Comments and trailing commas need to be removed first.

When JSON parsing fails

Inspect the reported error and the surrounding syntax. Replace single-quoted keys, remove trailing commas, and use lowercase true, false, and null. Comments require a different format such as JSONC; this formatter accepts standard JSON. Keep the original for duplicate keys and large-number checks.

Does valid JSON mean my configuration is correct?

No. Syntax validation confirms the data can be parsed. It does not check your application's schema, required fields, permissions, or business rules.

Can formatting change numbers or duplicate properties?

Parsing and re-serializing JSON can lose duplicate property names and precision for numbers beyond JavaScript's safe integer range. Keep a source copy and represent large identifiers as strings where your application allows it.

Explore practical guides and experiments

Why Valid JSON Still Breaks APIs: Types, Nulls, Numbers, and Structure

Learn why valid JSON can still fail an API. Debug strings vs numbers, null and missing fields, arrays, nesting, duplicate keys, booleans and payload structure.

Debug API Data with JSON, Base64, and Browser Tools

Work through JSON types, encoding, URL components, JWT claims, hashes, CSV conversion, and timestamps with small reproducible examples.

See the recorded experiment

10 Malformed JSON Inputs Tested in Our Formatter

Actual browser results for ten syntax errors, duplicate keys, and an integer that changes during formatting, with reusable inputs.