Toolkernel
  • CSV
  • JSON
  • Regex
  • PDF
  • JWT
  • YAML
  • Cron
Toolkernel

Free, privacy-focused developer tools that run entirely in your browser.

  • ✓ 100% browser-based
  • ✓ No data uploaded
  • ✓ Free forever

JSON & CSV

  • JSON Formatter
  • JSON Compare
  • JSON Auto-Fix
  • CSV Cleaner & Merger
  • YAML Formatter

PDF Tools

  • Merge PDF
  • Split PDF
  • Compress PDF
  • PDF to Images
  • All PDF Tools

More Tools

  • Regex Tester
  • JWT Decoder
  • Cron Builder

© 2026 Toolkernel. All rights reserved.

Your files never leave your device. Built for developers who value privacy.

  1. Toolkernel
  2. /
  3. JSON Tools
  4. /
  5. Auto-Fix
Powered by jsonrepair library

Fix Invalid JSONAutomatically

Paste broken JSON and repair it with one click. Fixes trailing commas, missing quotes, Python values, comments, and more. 100% browser-based—your data stays private.

1
Paste Invalid JSON
2
Click Format
3
Click Fix JSON
4
Copy Fixed JSON
Paste or upload JSON
Loading editor...
Ctrl+Ffind|▾ click to fold|use buttons to collapse/expand all
Formatted JSON will appear here...

What Errors Can Be Fixed?

Our JSON auto-fix tool repairs a wide range of common errors that make JSON invalid. Here are the most common issues we can fix automatically.

🔧

Trailing Commas

Removes commas after the last element in objects and arrays

Before: {"name": "John", "age": 30,}
After: {"name": "John", "age": 30}
💬

Missing Quotes

Adds double quotes around unquoted property names

Before: {name: "John", age: 30}
After: {"name": "John", "age": 30}
✨

Single Quotes

Converts single quotes to JSON-valid double quotes

Before: {'name': 'John'}
After: {"name": "John"}
🐍

Python Values

Converts True, False, None to JSON equivalents

Before: {"active": True, "data": None}
After: {"active": true, "data": null}
📝

Comments

Removes // line comments and /* block comments */

Before: {"debug": true} // enable debug
After: {"debug": true}
➕

Missing Commas

Adds missing commas between object properties or array elements

Before: {"a": 1 "b": 2}
After: {"a": 1, "b": 2}

Additional Errors We Can Fix

JavaScript undefined → null
NaN and Infinity → null
Invalid escape sequences (e.g., \x → \\x)
JSONP callback wrappers (e.g., callback({...}))
Concatenated JSON objects
MongoDB-style data formats
Unescaped special characters
Missing closing brackets/braces

Safe for Sensitive Data

Your JSON data never leaves your browser. Unlike other online tools that upload your data to servers, we process everything locally using JavaScript. This makes it safe to fix JSON containing API keys, credentials, or personal information.

No data uploaded to any server
Works offline after page load
No account required
No data logging or tracking

Frequently Asked Questions

Everything you need to know about fixing invalid JSON online.

What JSON errors can this tool fix automatically?

Our JSON auto-fix tool can repair: trailing commas, missing quotes around keys, single quotes instead of double quotes, Python values (True, False, None), JavaScript values (undefined, NaN, Infinity), comments (// and /* */), missing commas between elements, invalid escape sequences, and JSONP callback wrappers.

How do I fix 'Unexpected token' error in JSON?

Paste your JSON into our tool and click 'Format'. The error message will show you the exact position of the problem. If it's a fixable error (like a trailing comma or missing quote), click the 'Fix JSON' button to automatically repair it. The tool shows the line number and character position to help you locate the issue.

Can I fix JSON with Python True/False/None values?

Yes! Our tool automatically converts Python values to JSON equivalents: True becomes true, False becomes false, and None becomes null. Just paste your Python-style JSON and click 'Fix JSON'. This is especially useful when copying data from Python scripts or Django applications.

Is my JSON data safe when using this tool?

Yes, completely. All processing happens in your browser using JavaScript. Your JSON data never leaves your device and is never sent to any server. This makes it safe for fixing JSON containing sensitive information like API keys, passwords, or personal data.

Why does my JSON have a trailing comma error?

JSON specification doesn't allow trailing commas after the last element in objects or arrays. While JavaScript allows {"a": 1,}, JSON requires {"a": 1}. Our tool automatically removes these trailing commas to make your JSON valid.

How do I remove comments from JSON?

Standard JSON doesn't support comments, but our tool can remove them automatically. It handles both // single-line comments and /* multi-line comments */. Just paste your JSON with comments and click 'Fix JSON' to strip them out.

Can this tool fix JSON from API responses?

Yes! API responses sometimes come wrapped in JSONP callbacks like callback({...}) or with other formatting issues. Our tool can unwrap JSONP, fix malformed responses, and handle concatenated JSON objects that sometimes appear in log files.

What's the difference between Validate and Fix JSON?

Validate checks if your JSON is valid and shows error messages with line numbers. Fix JSON goes further - it automatically repairs common issues like trailing commas, missing quotes, and Python values. Use Validate to diagnose, use Fix to repair.

Common JSON Error Messages Explained

Understanding what your JSON error means helps you fix it faster.

Unexpected token } in JSON

Cause: Usually means a trailing comma before the closing brace

Fix: Remove the comma before } or ]

Expected property name or }

Cause: Unquoted property key or missing closing brace

Fix: Add double quotes around property names

Unexpected token ' in JSON

Cause: Using single quotes instead of double quotes

Fix: Replace all single quotes with double quotes

Unexpected identifier

Cause: Usually Python True, False, None, or unquoted strings

Fix: Use true, false, null (lowercase) and quote strings

Our auto-fix tool handles all these errors automatically. Just paste your JSON and click Fix JSON.

Related JSON Tools

✨

JSON Formatter

Format and beautify JSON with customizable indentation. Minify for production use.

⚖️

JSON Compare

Compare two JSON files side-by-side with semantic diff detection.

📖

Full Documentation

Complete guide to all JSON tools including transform, encode/decode, and more.