EN ES PT-BR
Data Processed in your browser Free

JSON Formatter & Validator

Paste raw or minified JSON and QuickTiny will validate it and format it with two-space indentation. If it's invalid — including common issues from copy-pasted ChatGPT or Claude output — you'll get a plain-English explanation and a one-click fix for safe, common cases.

Try it now

How to use JSON Formatter

  1. Paste raw or minified JSON into the box.
  2. Click "Format & validate".
  3. Valid JSON is reformatted with clean indentation; invalid JSON shows a clear error.
  4. Click "Copy output" to copy the result.

Fixing invalid JSON

When your JSON doesn't parse, QuickTiny explains why in plain English alongside the raw parser error — for example, pointing out a trailing comma, a single quote where a double quote belongs, or an unquoted key. If the problem is one of a handful of common, unambiguous issues (trailing commas, single-quoted strings, unquoted keys, a ```json markdown code fence still wrapped around the output, explanatory text before or after the JSON, or several JSON objects pasted back to back — the kind that show up constantly in output copied from ChatGPT, Claude, or hand-edited config files), click "Try to fix common issues" and QuickTiny will correct it automatically and tell you exactly what it changed. If the JSON is incomplete — missing a closing bracket or ending mid-string because a response got cut off mid-generation — QuickTiny will say so instead of guessing at what's missing, since there's no safe way to reconstruct content that was never there. Severely truncated JSON isn't something any automatic fixer can safely repair.

Example: fixing JSON copied from ChatGPT or Claude

AI chat responses commonly introduce the same handful of issues: a trailing comma left in after editing a list, a stray single-quoted string, or an unquoted key typed out of habit. Here's a realistic example with all three, pasted as-is:

Pasted in (invalid)
{
  "name": "Alex",
  "role": 'admin',
  city: "Austin",
  "tags": ["a", "b",]
}
After "Try to fix common issues"
{
  "name": "Alex",
  "role": "admin",
  "city": "Austin",
  "tags": [
    "a",
    "b"
  ]
}

QuickTiny reports exactly what changed: converted 1 single-quoted string to double quotes, removed 1 trailing comma, quoted 1 unquoted key — the same three fixes, whether the JSON came from ChatGPT, Claude, or was typed by hand.

Common JSON error messages, explained

Landed here searching for one of these exact messages? Here's what each one means and how to fix it — paste your JSON into the tool above and click "Try to fix common issues" instead of fixing it by hand.

"Expected property name or '}' in JSON at position 1"

JavaScript / Node.js — JSON.parse()Expected property name or '}' in JSON at position 1 (line 1 column 2)

This fires when the very first thing inside your opening { isn't a valid double-quoted key — almost always an unquoted key or a single-quoted key. Position 1 (column 2) is the character right after {, exactly where a key should start.

Broken (unquoted key)
{name: "Alex"}
Fixed
{"name": "Alex"}

A single-quoted key in that same spot — {'name': "Alex"} — throws the identical error. Both are exactly what "Try to fix common issues" corrects automatically.

"Unexpected token ' in JSON"

JavaScript / Node.js — JSON.parse()Unexpected token ''', "{"a":'x'}" is not valid JSON

The sibling error to the one above, but for a single-quoted value instead of a key — JSON requires double quotes for strings everywhere, not just in keys. V8 (Chrome, Node.js) echoes back the start of your actual input in the message, so the quoted part will match whatever you pasted rather than the example above.

Broken (single-quoted value)
{"role": 'admin'}
Fixed
{"role": "admin"}

Python: "Expecting property name enclosed in double quotes"

Python — json.loads()json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Python's json module uses this one message for all three causes above — an unquoted key, a single-quoted key, or a trailing comma — where JavaScript reports them as separate errors. The fix is the same regardless of which language eventually parses it: valid double-quoted keys and no trailing commas.

Broken (fails in Python)
{name: 'Alex'}
Fixed
{"name": "Alex"}

QuickTiny's formatter runs in your browser, not Python — but the corrected JSON it produces is valid everywhere. Paste your broken JSON above, fix it once, then copy the result into your Python code. Nothing you paste is uploaded or logged.

"Unexpected token '<'" (getting HTML instead of JSON)

JavaScript — JSON.parse() / fetch(...).json()Unexpected token '<', "<!DOCTYPE "... is not valid JSON

This means whatever you're parsing isn't JSON at all — it's HTML, almost always because an API call returned an error page (a 404 or 500 page, or a login redirect) instead of the JSON response you expected. The < at the very start is the opening angle bracket of <!DOCTYPE html> or <html>. Pasting the response into this tool won't fix it — the real fix is checking the actual HTTP response (your browser's Network tab, or logging the raw response body before calling .json()) to see what your server or API actually sent back.

"Unexpected end of JSON input"

JavaScript — JSON.parse()Unexpected end of JSON input

The JSON stopped in the middle of something — usually a response that got cut off (a network request that didn't finish, or AI chat output that hit a length limit mid-generation), or simply an empty string being parsed. Unlike a trailing comma or single quote, there's no safe way to guess what content was supposed to come next, so QuickTiny will tell you the JSON is incomplete rather than attempt a fix — you'll need the complete response, not a patch on this one.

Python: "Expecting value", "Expecting ',' delimiter", and "Extra data"

Python — json.loads()json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

These three Python messages cover different broken-JSON situations than the single-quote/unquoted-key error above:

Broken (missing comma)
{"a": 1 "b": 2}
Fixed
{"a": 1, "b": 2}

Paste any of these into the tool above and you'll see JavaScript's version of the same complaint, worded differently but pointing at the identical problem. A missing comma between two values still needs a manual edit. Concatenated JSON objects are different — "Try to fix common issues" now detects two or more complete JSON objects pasted back to back and offers to wrap them in an array instead of requiring you to split them by hand.

Key benefits

Privacy

JSON Formatter runs entirely in your browser using local JavaScript. Your JSON is processed on your own device and is never uploaded, logged, or stored by QuickTiny — including when using the automatic fix. There is no history feature and no record of what you've pasted.

Frequently asked questions

Is my JSON data uploaded anywhere?

No. Parsing, formatting, and automatic fixing all happen entirely in your browser. Nothing is uploaded, logged, or stored — QuickTiny doesn't keep a history of what you've pasted.

Can this fix invalid JSON?

Yes, for common and unambiguous problems: trailing commas, single quotes instead of double quotes, unquoted object keys, a leftover markdown code fence, explanatory text before or after the JSON, and multiple JSON objects pasted back to back. Click "Try to fix common issues" after a failed validation and QuickTiny will correct it and tell you exactly what it changed.

Can this fix JSON copied from ChatGPT or Claude?

Often, yes — the most common issues in AI-generated JSON (a ```json code fence still wrapped around the answer, a line of explanation before or after it, trailing commas, occasional single quotes) are exactly what the automatic fix targets. If the response got cut off mid-way, though, the JSON is genuinely incomplete, and QuickTiny will tell you that rather than guess at content that was never generated.

What does the error message tell me?

You'll see the browser's native JSON parse error plus, where QuickTiny can identify the likely cause, a plain-English explanation of what's probably wrong and why.

What can't the automatic fix handle?

Anything that requires guessing at missing content — like a truncated response missing its closing brackets, or a value that's ambiguous without more context. QuickTiny only applies fixes it can make with certainty; it will never quietly change what your data means.

Can I minify JSON with this tool?

This tool focuses on formatting, validating, and fixing. For minifying, remove the indentation manually or use JSON.stringify without a spacing argument in your own code.

Why does JSON.parse() say "Expected property name or '}'" or "Unexpected token '"?

Both mean JSON requires double quotes, not single quotes, everywhere a key or string appears. "Expected property name..." means the very first key in an object is unquoted or single-quoted; "Unexpected token '" means a string value is single-quoted. Paste your JSON above and click "Try to fix common issues" to convert single quotes and quote bare keys automatically.

Why does Python's json.loads() say "Expecting property name enclosed in double quotes"?

Python's json module reports this one message for unquoted keys, single-quoted keys, and trailing commas alike, where JavaScript reports each differently. The underlying fix is identical regardless of language: valid double-quoted keys and no trailing commas. Fix it once in the tool above, then use the corrected output in your Python code.

Why do I get "Unexpected token '<'" when parsing an API response?

Your code received an HTML page instead of JSON — almost always an error page (404/500) or login redirect from the API. Check the actual HTTP response in your browser's Network tab rather than trying to fix the "JSON" itself, since it isn't JSON at all.

What does "Unexpected end of JSON input" mean?

The JSON was cut off partway through — often a network response that didn't finish, or AI output that hit a length limit. There's no safe way to guess the missing content, so get the complete response rather than trying to patch this one.

Why does Python say "Expecting value", "Expecting ',' delimiter", or "Extra data"?

These cover different problems than the single-quote/unquoted-key error: a missing value, a missing comma between two key-value pairs, or extra content (often two JSON objects concatenated) after otherwise-valid JSON. Paste the JSON above to see exactly where it breaks.