JSON formatter and validator
Paste JSON to indent it and check that it's valid. If it isn't, you get a plain-English message and the line and column of the problem, and the line is marked in the editor.
What it does
- Strict JSON: comments, trailing commas, single quotes and unquoted keys are reported, with a clear message for each
- Compare two JSON documents: differences highlighted side by side, after laying both out the same way; Sort keys makes key order not count
- Errors give the line and column, and the line is highlighted
- Numbers are kept exactly as written: long integers and values like 1e400 are not rounded
- Indent with 2 spaces, 4 spaces or tabs
- Large documents format in a background thread, so typing never freezes
- Copy the result or download it as a .json file
Questions
- Why does my JSON with comments show an error?
- Standard JSON doesn't allow comments or trailing commas, so this formatter reports them instead of silently accepting input that other programs would reject.
- Will formatting change my numbers?
- No. Only whitespace changes. Large integers and numbers like 1e400 keep their exact digits, unlike tools that parse the JSON and print it again.
Other formatters
A private formatter for the formats you paste every day
Paste JSON, YAML, Mermaid, XML, SQL and Markdown on the left and get it tidied on the right as you type. Errors name the line and column. It formats and checks; it never converts one format into another.
What it does
- Several formats in one place. Each has its own page and its own remembered settings.
- Clear errors. They point at the line and highlight it in the input.
- Copy or download. Downloads use the right file type for each format.
- Smooth on big pastes. Formatting runs in a background worker, so typing stays responsive. Mermaid diagrams are drawn on the page itself.
- Extras where they help. Zoom and pan for Mermaid diagrams, a rendered preview for Markdown, and a dialect picker for SQL.
Questions
Is my data sent to a server?+–
No. Formatting runs in your browser, on your own device. What you paste is kept in memory only: it is never uploaded or saved.
Can it convert JSON to YAML, or other formats?+–
No, on purpose. Each page formats one format and keeps it that format.
What happens with invalid input?+–
You get an error with the line and column instead of a half-formatted result. JSON is checked strictly, so comments and trailing commas are reported.
Is anything remembered between visits?+–
Your settings (like the SQL dialect) and how you arranged the panes are remembered in your browser. The text you paste is not.