Dad’s Data formats tools

JSON5 → JSON

Normalize JSON5 to strict RFC 8259 JSON — strips comments, trailing commas, single-quoted strings, unquoted keys, and special numeric literals.

JSON5 Input
JSON Output

JSON output will appear here

Paste JSON5 in the input panel to normalize it to strict JSON.

What is JSON5?

JSON5 is a community-maintained superset of JSON that aims to make it easier to write and maintain configuration files by hand. It is specified at json5.org and adds a meaningful set of extensions over strict JSON (RFC 8259), all of which are valid ECMAScript 5.1 syntax.

Input
{
  // User configuration
  name: 'Alice',
  age: 30, // trailing comma
  'hobbies': ["reading", "coding",],
  active: true,
  score: 0xFF,
  ratio: .5,
}
Output
{
  "name": "Alice",
  "age": 30,
  "hobbies": [
    "reading",
    "coding"
  ],
  "active": true,
  "score": 255,
  "ratio": 0.5
}

JSON5 extensions

ExtensionJSON5 syntaxStrict JSON equivalent
Single-line comment// comment(removed)
Block comment/* comment */(removed)
Trailing comma (object){ "a": 1, }{ "a": 1 }
Trailing comma (array)["a", "b",]["a", "b"]
Single-quoted string'hello'"hello"
Unquoted key{ name: "Alice" }{ "name": "Alice" }
Hexadecimal integer0xFF255
Positive infinityInfinitynull (with warning)
Negative infinity-Infinitynull (with warning)
Not a numberNaNnull (with warning)
Leading decimal.50.5
Trailing decimal1.1.0
Multi-line string"line1\ line2""line1line2"
Warning: JSON has no representation for Infinity or NaN. This tool converts both to null and emits a warning. If you need to preserve these values, consider encoding them as strings before converting.

JSON5 vs JSONC vs JSON

FeatureJSONJSONCJSON5
CommentsNoYesYes
Trailing commasNoYesYes
Single-quoted stringsNoNoYes
Unquoted keysNoNoYes
Multi-line stringsNoNoYes
Hex numbersNoNoYes
Leading/trailing decimalNoNoYes
Infinity / NaNNoNoYes
Note: JSONC adds only comments and trailing commas. JSON5 adds all JSONC features plus single-quoted strings, unquoted keys, hex numbers, and more. Use the JSONC to JSON tool if your input only uses comments and trailing commas — it is simpler and slightly faster.

Common JSON5 files

File / ToolWhy JSON5?
.json5 filesExplicit JSON5 extension used by libraries and configs that adopt the spec
Babel configBabel can read babel.config.json5 natively
Hand-written configsAuthors prefer unquoted keys and comments for readability
Test fixturesSingle-quoted strings and inline comments make fixtures more readable

Frequently Asked Questions

Your files stay on your computer. Dad promised.

Data formats tools

Search the Data formats tools