JSON5 Formatter
Format JSON5 with comments and trailing commas.Runs in this tab.⌘ ↵ runs it
Next step
AtriumKitFrom the team behind browserutils
Turn a click-through into an interactive demo
AtriumKit records your web app once in Chrome and turns every click into a step of a demo you can embed or share. There’s a free plan.
Try AtriumKit freeAbout JSON5 Formatter
Free online JSON5 formatter and beautifier. Format JSON5 documents that include comments, trailing commas, and unquoted keys. It runs in your browser. Nothing is sent to a server.
Questions
What is JSON5 and how is it different from JSON?
JSON5 is an extension of JSON that allows comments (single and multi-line), trailing commas, unquoted keys, single-quoted strings, and other conveniences. This formatter handles all these features while producing clean, indented output.
Can I use this to format regular JSON too?
Yes, since JSON is a valid subset of JSON5, you can use this formatter for standard JSON files as well. It will format them with proper indentation while preserving any JSON5 features present.
Does the JSON5 formatter preserve comments?
Yes, both single-line (//) and multi-line (/* */) comments are preserved in the formatted output, which is one of the main advantages of JSON5 over standard JSON.
Where is JSON5 commonly used?
JSON5 is used in configuration files where comments are helpful, such as Babel configs, ESLint configs, and VS Code settings files. It provides the structure of JSON with the readability of a more forgiving syntax.
Comments
More in Formatters & Beautifiers
- HTML Formatter
- CSS Formatter
- JavaScript Formatter
- SQL Formatter
- XML Formatter
- Markdown Preview
- CSS Minifier
- HTML Minifier
Comments