JSON Converters Code Gen Formatters All tools Browse all tools built byAbhay Darji

JSON5 Formatter

Format JSON5 — comments, trailing commas, unquoted keys and single quotes all welcome.

100% client side No upload No size limit Works offline
Input
Output
Ready
Drop a file to load it

About this tool

JSON5 extends JSON with the things people keep wanting: comments, trailing commas, unquoted keys, single-quoted strings and hexadecimal numbers. This formatter accepts all of them.

When you would use it

  • Tidying a `.json5` config file
  • Formatting a JavaScript object literal
  • Cleaning up a config that uses comments

Worked example

JSON5
{
  // identifier
  id: 0xFF,
  name: 'Ada',
}
Formatted
{
  "id": 255,
  "name": "Ada"
}

Things worth knowing

  • Output is strict JSON by default, which is what you usually want downstream. Comments cannot be preserved because strict JSON has no syntax for them.
Questions

Frequently asked

What is JSON5?
An extension of JSON that adds comments, trailing commas, unquoted keys, single quotes and hex numbers. It is popular for configuration files where human editing matters more than machine interchange.
Is my data uploaded anywhere?
No. Every tool on JSONWorks runs entirely in your browser using JavaScript. Your input is never sent to a server, never logged and never stored. The simplest proof is to disconnect from the internet — the tools keep working. The site does load Google Fonts and a Google Analytics page-view tag, so you will see those two requests in your network tab, but neither receives anything you type or paste.
Does it work offline?
Yes. JSONWorks is installable as a progressive web app and caches itself on first visit, so every tool keeps working without a connection.
Related

Tools that pair well with this