Skip to content

JSON5 to JSON Converter

Convert JSON5 (JSON with comments, trailing commas, unquoted keys) to standard JSON format.

Input

json
loading editor…

Paste your JSON5 here...
or drop a file anywhere in this pane

Output

json

Standard JSON will appear here...
press to json5 to json

What Is JSON5?

JSON5 is an extension of the JSON format designed to make it easier for humans to write and maintain. It retains the full expressiveness of JSON while adding features that developers commonly expect, such as comments, unquoted keys, trailing commas, and more flexible number and string syntax.

JSON5 is commonly used for:

  • Configuration Files: Adding explanatory comments to config files.
  • Development Scripts: Writing data by hand with fewer syntactic restrictions.
  • Build Tools: Tools like Babel and webpack support JSON5 for their configs.
  • Data Samples: Providing annotated example data for documentation.

What Is Standard JSON?

Standard JSON (RFC 8259) is a strict subset of JavaScript object literal syntax. It requires double-quoted strings, no comments or trailing commas, and specific formatting for numbers and special characters. While this strictness makes parsing fast and predictable, it can be tedious for humans to write.

JSON5 vs. JSON: Key Differences

The primary difference is developer experience. JSON5 allows single-quoted and unquoted strings, multiline strings, comments, trailing commas, hexadecimal numbers, and leading decimal points. Standard JSON permits none of these, making JSON5 significantly more user-friendly for hand-written files.

How to Convert JSON5 to JSON Online

  1. Paste your JSON5: Copy your JSON5 code into the input box.
  2. Review for Issues: The tool automatically validates and prepares your input for conversion.
  3. Click Convert: Press the button to transform JSON5 into strict standard JSON without comments or extra syntax.
  4. Copy & Use: Use the Copy button to grab the clean JSON for use in environments that require strict JSON compliance.

Frequently Asked Questions

Is this JSON5 to JSON converter safe?

Yes. All conversion happens 100% client-side in your browser. Your data is never uploaded to any server.

Does the conversion preserve comments?

No, standard JSON does not support comments. The converter strips all comments during the conversion. Use the Swap button to convert back to JSON5 where comments are preserved.

What happens if my JSON5 has syntax errors?

The tool will highlight any invalid syntax so you can fix it before conversion. JSON5 is more lenient than JSON but still follows specific rules.

Real-World Examples

Developers often write configuration files in JSON5 during development for readability, with the option to convert to strict JSON before deployment. This workflow is common with bundlers like webpack or Parcel, which natively support JSON5 but may need to output standard JSON for production.

Related Tools