← Back to Tools

JSON Formatter & Fixer

Format JSON and automatically fix common syntax errors

Settings

JSON Input

Formatted Output

Features

  • Auto-fix errors: Automatically repairs common JSON syntax errors
  • Single to double quotes: Converts single quotes to valid double quotes
  • Trailing comma removal: Removes invalid trailing commas
  • Unquoted keys: Adds quotes to unquoted object keys
  • Format options: Choose between 2 spaces, 4 spaces, or compact
  • Real-time formatting: Updates as you type

Common JSON Errors Fixed

  • Single quotes: 'name' → "name"
  • Unquoted keys: {key: value} → {"key": "value"}
  • Trailing commas: [1, 2,] → [1, 2]
  • Missing commas: {"a": 1 "b": 2} → {"a": 1, "b": 2}
  • Comments: Removes // and /* */ comments
  • Undefined values: Handles undefined properly