📄 JSON5 Formatter & Validator

Format, validate, and convert JSON5 to standard JSON. Supports comments, trailing commas, unquoted keys, hex numbers, and more.

📂 Drag & drop a .json5, .jsonc, or .json file here
JSON5 Input 0 chars
Formatted JSON5 0 chars

What is JSON5?

JSON5 is an extension of JSON that aims to be easier to write and maintain by hand. It's not a replacement for JSON but rather a superset that allows for a more relaxed, human-friendly syntax while remaining fully compatible with JavaScript object literals.

JSON5 Features

💬 Comments

// Single-line comment
/* Multi-line
   comment */

🔑 Unquoted Keys

{
  name: "value",
  $price: 99,
  _private: true
}

✂️ Trailing Commas

{
  "items": [
    "one",
    "two",
    "three",  // OK!
  ],
}

🔤 Single Quotes

{
  'single': 'quotes',
  "mixed": 'allowed'
}

🔢 Special Numbers

{
  hex: 0xDEADBEEF,
  infinity: Infinity,
  negInfinity: -Infinity,
  nan: NaN,
  leadingDot: .5,
  trailingDot: 5.
}

📝 Multi-line Strings

{
  multiline: "Line 1\
Line 2\
Line 3"
}

JSON5 vs JSON vs JSONC

Feature JSON JSONC JSON5
Comments❌✅✅
Trailing commas❌✅✅
Unquoted keys❌❌✅
Single quotes❌❌✅
Hex numbers❌❌✅
Infinity/NaN❌❌✅
Multi-line strings❌❌✅
Leading/trailing decimals❌❌✅

Common Use Cases

Related Tools