PlayWithJSON

JSON5 Formatter & Studio

Comments & Trailing Commas

Format, beautify, and validate modern JSON5 documents with comments, unquoted keys, single quotes, and hex numbers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Ln 1, Col 1|34 lines|808 chars
Spaces: 2|JSON5|UTF-8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Ln 1, Col 1|33 lines|541 chars
Spaces: 2|JSON5|UTF-8

JSON5 Formatter & Studio Online

Format, beautify, validate, and inspect JSON5 documents with PlayWithJSON's free online JSON5 formatter. JSON5 is an official extension to JSON that expands its syntax to include the production of ECMAScript 5.1.

Our JSON5 editor allows inline (//) and block (/* */) comments, unquoted object keys, single-quoted strings, trailing commas, hexadecimal numbers, and IEEE 754 floats. All operations run 100% locally in your browser for total privacy.

{}

Why Use PlayWithJSON?

  • Supports // and /* */ comments
  • Permits unquoted keys & single quotes
  • Allows trailing commas in arrays & objects
  • 100% Free and works completely offline
  • No telemetry or server uploads

What Can You Do With Our JSON5 Formatter?

Full Comments Support

Preserve and inspect single-line (//) and multi-line (/* */) comments in configuration files.

Clean ES5 Formatting

Beautify JSON5 with unquoted identifier keys and customizable indentation.

Instant Syntax Validation

Check for JSON5 syntax discrepancies and get accurate line/column error feedback.

Interactive Tree Inspector

Navigate complex nested JSON5 object trees and collapse nodes seamlessly.

Multi-Pane Split Studio

Open up to 4 parallel JSON5 editor panes for side-by-side comparison.

Export & Copy

One-click copy to clipboard or download formatted .json5 config files.

How to Format JSON5 Online

1

Paste or type JSON5

Enter your JSON5 or standard JSON code into any editor panel.

2

Click Format

The formatter beautifies comments, quotes, and indentation automatically.

3

Inspect in Tree or Raw View

Toggle between raw text and visual tree inspection with one click.

4

Copy or Download

Copy the formatted JSON5 or export it directly to your project.

JSON5 Formatting Example

Minified JSON5 (Before)
{// user config name:'Alice',age:28,role:'admin',/* active */enabled:true,}
Formatted JSON5 (After)
1{
2 // user config
3 name: 'Alice',
4 age: 28,
5 role: 'admin',
6 /* active */
7 enabled: true,
8}

JSON5 Syntax Validation Example

Invalid JSON5 Syntax
1{
2 name: 'Alice',
3 age: 28,
4 tags: ['admin', 'dev'
5}
JSON5: invalid character or unclosed array bracket at line 4
Valid JSON5 (Fixed)
1{
2 name: 'Alice',
3 age: 28,
4 tags: ['admin', 'dev'],
5}

Supported JSON5 Features

Single-line (//) comments
Multi-line (/* */) comments
Unquoted object keys
Single-quoted strings
Trailing commas allowed
Hexadecimal numbers (0xdecaf)
Leading/trailing decimal points
Positive sign prefix (+42)
Infinity, -Infinity, and NaN
Multi-line string continuations
Interactive tree visualization
100% Client-side and private
Frequently Asked Questions

Frequently Asked Questions about JSON5

JSON5 is an official superset of JSON that aims to make it easier for humans to write and maintain by hand. It incorporates ECMAScript 5.1 syntax such as comments, unquoted keys, single quotes, and trailing commas.

More JSON Developer Tools

View All Tools

JSON Formatter

Format, validate and inspect JSON data

JSON5 Formatter

Format and validate JSON5 with comments

JSON ↔ JSON5

Convert between JSON and modern JSON5

JSON to TypeScript

Generate TypeScript interfaces from JSON

JSON to Zod

Generate Zod schemas from JSON

Text to JSON

Convert text and schemas into structured JSON

JSON Sorter Online

Sort JSON keys alphabetically and order arrays

JWT Decoder Online

Decode JWT header, payload and expiration

JSON Stringify Online

Escape quotes and stringify or unescape JSON

Mock JSON Generator

Generate realistic mock data for APIs and testing

JSON to CSV

Export structured JSON arrays into CSV spreadsheets

JSONPath Tester

Query and filter JSON data with path expressions

JSON Schema Generator

Generate JSON Schema from sample JSON

JSON Diff & Compare

Compare two JSON objects and find differences

JSON ↔ YAML

Convert JSON/JSON5 to YAML and back with comments

JSON ↔ XML

Convert JSON to XML and XML to JSON with attributes

YAML to CSV

Convert YAML lists and objects into spreadsheets

CSV to JSON / JSON5

Convert CSV/TSV to JSON or JSON5 with type parsing

JSON to BigQuery

Generate BigQuery Schema JSON and CREATE TABLE DDL

JSON to GraphQL

Generate GraphQL SDL types, queries, and inputs

JSON to MySQL

Generate MySQL CREATE TABLE DDL and INSERT queries

JSON to PostgreSQL

Generate PostgreSQL CREATE TABLE DDL, JSONB and INSERTs

JSON Flattener

Flatten nested JSON to dot notation or unflatten back

JSON Tree Visualizer

Interactive SVG mindmap graph and collapsible node tree

JSON Minifier Online

Compact and compress JSON by stripping whitespace

JSON Token Counter

Calculate LLM tokens (GPT-4o, Claude) and API costs

Broken JSON Repair

Automatically heal broken and truncated AI/LLM JSON