JSON5 and JSON with comments formatter
Paste JSON that has comments or trailing commas, such as tsconfig.json, a VS Code settings file or a .jsonc file, or JSON5 with unquoted keys and single-quoted strings, and format it without losing a single comment. Minify turns it into plain JSON.
Comments kept where they are
Line comments (//) and block comments are kept: above a property, after it on the same line, or at the end of an object or array. Blank lines between groups of properties stay too.
Plain JSON when you need it
Minify drops the comments and trailing commas, which leaves standard JSON that any parser accepts, on one line.
Detected for you
Text that is JSON except for its comments or trailing commas is recognised as JSON with comments, and so are .jsonc files, tsconfig.json, jsconfig.json and devcontainer.json.
JSON5 stays JSON5
Format keeps JSON5 as you wrote it: unquoted keys stay unquoted, single-quoted strings keep their quotes, and hexadecimal numbers, Infinity and NaN are left as they are. Only the layout changes.
Keyboard shortcuts
- Format: Shift+Alt+F (⌥⇧F on a Mac)
- Minify: Shift+Alt+M (⌥⇧M on a Mac)
- Undo: Ctrl+Z (⌘Z on a Mac). Each Format or Minify is a step of its own.
- Find and replace: Ctrl+F (⌘F on a Mac)
Private: nothing is uploaded
Formatting, checking and comparing all happen in your browser. Your documents are saved in the browser's own storage on this computer, not on a server, so they never leave your device.
With your permission, we count anonymous visits (which pages and tools are used), never what you type. See Privacy.
Questions
Can I remove comments from JSON?
Yes: Minify removes every comment and trailing comma. Format the result afterwards if you want it laid out over several lines.
Is my data uploaded anywhere?
Your documents aren't: everything runs in your browser, and they are saved on your computer, in the browser's storage for this site. With your permission we count anonymous visits, never their content.
More tools
- Formatter & Converter for JSON, YAML, XML, SQL
- JSON Formatter, Validator & Minifier
- JSON Diff – Compare Two JSON Files Online
- JSON Unescape – Read Stringified JSON
- JSON Escape – Turn Text into a JSON String
- JSON to YAML Converter
- YAML to JSON Converter
- JSON to TOML Converter
- TOML to JSON Converter
- Online Diagram & Flowchart Editor
- UUID, Password, Hash & Secret Key Generators