JSON Formatter & Validator

Beautify, minify and validate JSON.

How to use

  1. Paste JSON into the input.
  2. Choose Beautify or Minify.
  3. Fix any error shown, then copy or download the result.

Questions

Is my JSON sent to a server?
No. It is parsed locally with your browser’s JSON engine.
Why does it say invalid?
Common causes: trailing commas, single quotes, unquoted keys or comments. The error shows the line and column.
Is there a size limit?
Up to 5 MB is supported comfortably.

JSON Syntax Rules & Common Parse Errors Guide

Quick reference for strict RFC 8259 JSON syntax, valid data types, escape sequences, and instant fixes for common JSON.parse() errors.

Valid JSON Data Types

RFC 8259

JSON supports six value types. Functions, undefined, Date objects, and comments are not valid JSON.

TypeExampleRule
String"hello"Double quotes only
Number42, -3.14, 1e5No leading zeros or NaN
BooleantrueLowercase true or false
NullnullLowercase only (not undefined)
Array[1, "a", true]Ordered list, no trailing comma
Object{"id": 1}Double-quoted keys only

Common Parse Errors & Fixes

Debugging

Most parse errors happen when pasting JavaScript object literals or config files into strict JSON.

MistakeBroken ExampleValid JSON Fix
Single quotes{'name': 'Ana'}{"name": "Ana"}
Unquoted key{port: 3000}{"port": 3000}
Trailing comma{"a": 1,}{"a": 1}
Inline comment{"a": 1} // note{"a": 1}
Undefined value{"x": undefined}{"x": null}

JSON vs. JavaScript Object

Comparison

JSON looks like JavaScript syntax, but it is a strict text data format with fewer allowances.

FeatureJavaScript ObjectStrict JSON
Property keysQuotes optionalDouble quotes required
String quotes'single' or "double"Double quotes only
Trailing commasAllowedSyntax error
Comments// and /* */ allowedNot allowed

String Escape Sequences

Escaping

Quotes, backslashes, and control characters inside JSON strings must be escaped with a backslash.

SequenceMeaningExample
\"Double quote"Say \"hi\""
\\Backslash"C:\\Users\\Alex"
\nNewline"Line 1\nLine 2"
\tTab character"Col1\tCol2"
\uXXXXHex Unicode"\u00A9 2026"

About JSON Formatter & Validator

PlainTool JSON Formatter validates, beautifies, and minifies JSON data right in your browser with clear line-and-column error messages whenever syntax breaks. Sensitive API payloads, config files, and auth tokens stay completely local and never hit external servers.

Toggle between readable indented output (great for debugging nested objects) and compact single-line minification (great for reducing payload size).

Common use cases

  • Pretty-printing compressed API responses and webhook logs to inspect nested fields quickly.
  • Hunting down missing commas, unquoted keys, or trailing commas in configuration files.
  • Minifying JSON fixtures before pasting them into environment variables or network tests.

Practical tips

  • If validation fails on a copied JavaScript object literal, check for single quotes, trailing commas, or unquoted property names—strict JSON requires double quotes.
  • Use Minify before storing JSON inside `.env` strings or compact URL parameters.

Limits & compatibility: Very large JSON files (tens of megabytes) may feel sluggish in browser textareas; standard API responses and config files format instantaneously.