Developer · Free

JSON Formatter & Validator

Format, validate and minify JSON in your browser. Invalid JSON shows the parser's message and, in most browsers, the line and column where parsing stopped. Indent with 2 or 4 spaces or tabs, sort keys, and explore a searchable tree with JSON paths and statistics. Paste text or open a .json file up to 10 MB; it is not uploaded.

JSON never leaves this browser
Report a problem
Input editor
Paste JSON or drop a .json file
21 lines·415 B
Valid JSON
Root: object · 5
1{
2 "project": "Toolkit",
3 "version": 1,
4 "active": true,
5 "tools": [
6 {
7 "name": "JSON Formatter",
8 "category": "Developer",
9 "features": [
10 "format",
11 "validate",
12 "inspect"
13 ]
14 },
15 {
16 "name": "Scientific Calculator",
17 "category": "Calculators",
18 "features": [
19 "trigonometry",
20 "calculus",
21 "vectors"
22 ]
23 }
24 ],
25 "metadata": {
26 "private": true,
27 "serverUpload": null
28 }
29}
Output 479 B
Nothing is uploaded. Formatting, validation, search and statistics run in your browser.⌘/Ctrl + Enter format · Tab indents
How it works

From raw JSON to readable, verified data.

The editor validates on every change. Once the structure is valid, choose a clean output format and inspect the document without switching tools.

  1. 01

    Paste JSON or open a file

    Paste into the editor, drag in a .json file, or choose Open JSON. Files up to 10 MB are read by your browser; larger files are not opened.

  2. 02

    Fix any errors

    Validation runs as you type. If the JSON is invalid, read the parser message, the line and column, and the excerpt under the editor, then edit until it shows Valid JSON.

  3. 03

    Format or minify

    Choose 2 spaces, 4 spaces or Tab, tick Sort keys to alphabetize them, then press Format JSON (Ctrl or ⌘ + Enter) or Minify (add Shift). Copy the output or download it as a .json file.

  4. 04

    Inspect the structure

    Open Tree view to expand objects and arrays, or search keys, values and paths such as $.users[0].name. Statistics counts objects, arrays, keys and each value type, plus the nesting depth.

Built for real payloads

More than a basic JSON beautifier.

Precise validation feedback

Find malformed JSON with useful parser diagnostics, line and column locations, and the affected line instead of a generic invalid message.

Formatter and tree inspector

Pretty-print with two spaces, four spaces or tabs, sort keys recursively, and search keys, values or JSON-style paths in a collapsible tree.

Private document analysis

Calculate value counts, types, nesting depth and file size without uploading source data or formatted output to a server.

JSON formatting questions

Know exactly what the validator checks.

How do I format JSON online?+

Paste your JSON, choose 2 spaces, 4 spaces or Tab, and press Format JSON or Ctrl/⌘ + Enter. The result appears with syntax colours and line numbers, ready to copy or download. Tick Sort keys to alphabetize property names at every level; array items always keep their order.

How do I find the error in invalid JSON?+

The validator runs JSON.parse in your browser and shows its message, such as Expected ',' or '}' after property value, with the line, column and source line when the browser reports a position. Chrome, Edge and Firefox report one; Safari's messages usually do not. JSON.parse stops at the first error, so fix it and check again.

What are the most common JSON syntax errors?+

Trailing commas after the last item, single-quoted strings, unquoted property names, missing commas or colons, comments, and unescaped line breaks inside strings. Values such as undefined, NaN and functions are not JSON either. Standard JSON needs double quotes and allows no comments, so JSONC or JSON5 files with comments show as invalid here.

Can I minify JSON?+

Yes. Press Minify, or Ctrl/⌘ + Shift + Enter, to remove all indentation and line breaks between values. Text inside strings is untouched. The output size appears under the result, so you can compare it with the input size shown above the editor before copying or downloading.

Can formatting change my data?+

The values stay the same with three exceptions, because the JSON is parsed as JavaScript. Integers beyond 9,007,199,254,740,991 lose precision (12345678901234567890 becomes 12345678901234567000), numbers are rewritten in their shortest form (1.50 becomes 1.5 and 1e3 becomes 1000), and if a key appears twice in one object, only the last value is kept.

How do I inspect a large nested JSON document?+

Open Tree view and expand only the objects or arrays you need; the first two levels open automatically. Search matches property names, values and paths such as $.users[0].email, shows up to 100 results, and clicking a result copies its path.

Is my JSON uploaded or stored?+

No. Validation, formatting, tree search and statistics all run in your browser, and files are read locally with browser APIs. Your JSON is not sent to a Toolkit server or saved, so reloading the page brings back the example.

Can the tool validate a JSON Schema?+

No. It checks that the text is valid standard JSON and shows its structure, but it does not test a document against a JSON Schema, an OpenAPI definition or another API contract.

More focused tools, ready when you are.

Explore the growing collection for calculations, documents, writing, and everyday work.

Browse all tools