JSON5 to JSON Converter

JSON Tools

How to use the JSON5 to JSON Converter

Convert JSON5 to standard JSON instantly:

1

Paste your JSON5

Paste any JSON5 content — with comments, trailing commas, unquoted keys, or single-quoted strings.

2

Click Convert

The tool parses all JSON5-specific syntax and outputs valid, strictly compliant JSON.

3

Copy the result

Copy the clean JSON output and use it with any standard JSON parser, validator, or API.


When to use this tool

Use this whenever you need strict JSON from a JSON5 or JSON-with-comments source:

  • Converting tsconfig.json or jsconfig.json (which allow comments) to plain JSON for tools that only accept strict JSON
  • Stripping comments from .eslintrc, .babelrc, or .prettierrc config files before parsing them programmatically
  • Cleaning up JSON copied from documentation, blog posts, or code comments that includes JS-style syntax
  • Preprocessing JSON5 config files in a CI pipeline that feeds data to a strict JSON parser
  • Migrating a project from JSON5-style config files to a format compatible with JSON Schema validators
  • Removing trailing commas from hand-edited JSON that was rejected by JSON.parse()

Frequently asked questions

Q:What's the difference between JSON5 and standard JSON?
JSON5 extends JSON with developer-friendly syntax: // single-line comments, /* */ multi-line comments, trailing commas in arrays and objects, unquoted object keys, single-quoted strings, and special number values like Infinity and NaN. Standard JSON supports none of these — JSON.parse() will throw a SyntaxError on any of them.
Q:Are both single-line and multi-line comments stripped?
Yes. Both // single-line comments and /* */ multi-line comments are fully removed during conversion. The stats bar shows exactly how many comment blocks were stripped from your input.
Q:What config files commonly use JSON5 or JSON-with-comments?
tsconfig.json, jsconfig.json, .eslintrc, .babelrc, .prettierrc, and many VS Code settings files use a JSON-with-comments (JSONC) format. This tool handles all of them — paste the file contents directly and get clean standard JSON out.
Q:How are Infinity, -Infinity, and NaN handled?
JSON has no equivalent for these JavaScript number literals, so they are converted to null during conversion. This is the standard approach — the info banner will note this if your input contains any of these values.
Q:What happens to unquoted keys and single-quoted strings?
Unquoted object keys (like { id: 1 }) and single-quoted strings (like 'hello') are both normalised to double-quoted strings in the output, making the result fully compliant with the JSON specification (RFC 8259).
Q:Is there a difference between JSON5 and JSONC?
JSONC (JSON with Comments) is a subset that only adds // and /* */ comments to standard JSON — it still requires quoted keys, double-quoted strings, and no trailing commas. JSON5 is a broader superset that adds all of those on top. This tool handles both formats.