JSON5 to JSON

Convert JSON5 (with comments, trailing commas, unquoted keys) to standard JSON. Supports single-quoted strings and hex literals.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

or drag & drop a file

0 chars
Line comments (//)Block comments (/* */)Trailing commasSingle-quoted stringsUnquoted keys

What is JSON5 to JSON Converter?

This tool converts text written in JSON5 format into standard JSON (RFC 8259).

JSON5 is an extended format that allows comments, trailing commas, single quotes, and more, making it convenient for config files and code comments. This tool lets you convert JSON5 into clean JSON that can be passed to standard APIs or parsers.

How to Use

  1. Paste your JSON5 into the input field and click "Convert to JSON". Click "Sample" to see an example.
  2. Line comments (//), block comments (/* */), and trailing commas are all removed automatically.
  3. Use "Indent" to change the output indentation width (2, 4, or tab).
  4. Enable "Sort keys" to reorder object keys alphabetically.
  5. Click "Copy" to copy the result to your clipboard, or "Download" to save it as a `.json` file.

FAQ

What is JSON5?

JSON5 is an extended version of JSON that allows comments, trailing commas, single-quoted strings, unquoted keys, hexadecimal literals, and more. It's convenient for writing config files, but standard JSON parsers can't read it, so it needs to be converted.

Can Infinity and NaN be converted too?

Yes. JSON5's Infinity and NaN are converted to strings. Since standard JSON has no such numeric literals, adjust them after conversion as needed for your use case.

Can deeply nested JSON be processed?

Yes. Parsing is recursive, so deep nesting is supported. However, be mindful of your browser's memory limits with very large files.

Is my data sent to a server?

No. All processing happens entirely in your browser.