Free browser tool · No account required

Online JSON Formatter & Validator

Paste JSON to check its syntax, add readable indentation or remove unnecessary whitespace. Your input stays in this page.

🔒 100% Client-Side Processing: Your data never leaves your browser.

JSON input is never uploaded. This tool uses no analytics, external libraries or browser storage. Opening this page still makes a normal website request. Copy only writes output to your clipboard when you ask.

Up to 1 MiB of UTF-8 input, 8 MiB of formatted output and 128 nested containers. Number literals and key order are preserved. Validation checks JSON syntax, not a JSON Schema or API contract.

Paste JSON or load the example to begin.

How to Format and Validate JSON Online

  1. Paste your JSON. Use the response body or JSON document, not an HTML page, JavaScript assignment or Markdown code block.
  2. Choose indentation. Select 2 or 4 spaces. Auto-format updates after you pause typing; turn it off to work manually.
  3. Check the result. Click Format JSON or Minify. If validation fails, read the line, column and reason, then use Go to error to locate the problem.
  4. Copy the output. Use Copy output. If your browser blocks clipboard access, select the output and press Ctrl+C or Command+C. Clear removes both fields.

Formatting adds whitespace outside strings. Minifying removes that whitespace; it does not shorten string values or fix invalid JSON.

Troubleshooting Common JSON Syntax Errors

SyntaxError: Unexpected token < at position 0

An opening < often means you copied HTML: a login screen, proxy error or server error page. Check the HTTP status and the actual response body before formatting it. The endpoint may have returned a page instead of the JSON you expected.

Not JSON: <!doctype html>
Valid JSON: {"status": "ok"}

Expected double-quoted property name

JSON is stricter than a JavaScript object literal. Object keys and string values require double quotes. Comments, unquoted keys and single-quoted strings are not allowed. A trailing object comma can produce the same browser message.

Invalid: {name: 'Emma'}
Valid:   {"name": "Emma"}

Unexpected trailing comma

A comma separates items; it cannot follow the final item. Remove the comma immediately before } or ]. Keep the commas between properties or array values.

Invalid: {"tracks": ["voice", "music",]}
Valid:   {"tracks": ["voice", "music"]}

Line and column numbers start at 1. An error marks where the parser could no longer continue; a missing quote or bracket may need to be fixed earlier. Error wording differs across browsers; this tool provides its own consistent diagnostics.

JSON Formatter FAQ

Is my JSON uploaded or saved?

No. The formatter processes input in this page, without uploading it or saving it in cookies or browser storage. Clear removes it from the tool. Copy writes only the output to your clipboard at your request. Loading the hosted page still makes a normal request to the website.

Does formatting change numbers or duplicate keys?

This formatter preserves number literals, key order and duplicate keys while changing whitespace outside strings. Duplicate keys trigger a warning because other JSON parsers may keep only one value. It does not convert large numbers to JavaScript numbers.

Why do I get Unexpected token < at position 0?

Your input may be HTML instead of JSON, such as a login page or an error response. Check the API response status and body. Do not remove the opening angle bracket to force it to parse.

What does Expected double-quoted property name mean?

JSON object keys must be strings in double quotes. Replace an unquoted key or a single-quoted key with a double-quoted key. A comma directly before the closing brace can also cause this error.

How do I fix an unexpected trailing comma?

Remove the comma after the final property or array item. JSON does not allow trailing commas. Keep commas between items.

About this tool

Built for ToolBrivio. This is a syntax formatter, not a security scanner: valid JSON can still contain incorrect or unsafe application data. Numbers and duplicate keys are preserved to avoid silently rewriting your input. Large or deeply nested inputs are deliberately limited to keep the page responsive.

Updated · Maintained by ToolBrivio Editorial

References: RFC 8259: JSON syntax · MDN: JSON.parse and number precision · Corrections and feedback