JSON format and validate
Format, minify or sort JSON, repair common mistakes, or escape it as a string. Errors show the line and column, and large numbers keep every digit.
Process locally
Files stay in this browser session. Closing or clearing releases them.
Add text
Type or paste the text to process
Adjust settings
Optional: Operation, Indent, Sort keys
Run
Processes in this browser; cancel at any time
About this tool
Format, validate, minify or repair JSON. Use it to make a minified API response readable while you debug, to find the exact line and column of a syntax error in a config file, or to turn a piece of JSON into an escaped string you can put in code.
Numbers keep every digit, so long IDs such as 12345678901234567890 and values like 1.50 are not rounded or rewritten. Up to 1 MB of text is processed right in your browser, and nothing is uploaded to a server.
How to use it
- Type or paste your JSON, or select Use example to load a sample with a long number.
- Pick an “Operation”: “Format”, “Minify”, “Repair and format”, “Escape as a string” or “Unescape a string”. For formatted output, choose the “Indent” and whether to “Sort keys”.
- Select Run. If the JSON is invalid, the error names the line and column.
- Preview the result, then download it as a JSON file, or as a text file for escaped and unescaped strings.
Formats and limits
- Input
- Text
- Output
- JSON, Plain text
- Size limit
- 1 MB
- Settings
- Operation (Format, Minify, Repair and format, Escape as a string, Unescape a string); Indent (2 spaces, 4 spaces, Tab); Sort keys
- Privacy
- Files stay in the current browser session. No file bytes are uploaded.
- Price
- Free, no sign-up
Common questions
Will large numbers lose precision?
No. Standard JavaScript parsing loses precision for integers above 9007199254740991, but this tool keeps every number exactly as written, including trailing zeros such as 1.50.
How do I fix trailing commas, single quotes or comments?
Strict JSON does not allow them, so “Format” stops with an error. Choose “Repair and format”: it removes trailing commas and comments, adds quotes around bare keys, turns single quotes into double quotes and closes brackets missing at the end.
Why does it report a duplicate key?
When the same key appears twice in one object with different values, the tool reports it instead of silently keeping one of them. Rename or remove one of the keys and run again.
What do “Escape as a string” and “Unescape a string” do?
Escaping turns the text into the inside of a JSON string: quotes, backslashes and line breaks become \", \\ and \n, while non-ASCII characters such as Chinese stay as they are. Unescaping does the reverse and accepts the text with or without the surrounding quotes.
Does “Sort keys” change the order of arrays?
No. Keys are sorted in every nested object, by character code, so uppercase letters come before lowercase ones. Array items keep their order.
Workflows that use this tool
Related tools
JSON, YAML and XML converter
Validate, pretty-print or convert between JSON, YAML and XML for their shared subset. External entities and custom tags are rejected.
Code formatter
Format or minify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown, YAML, XML, SQL, C, C++, C#, Java, PHP, Python and nginx configuration.
JSON to code types
Generate TypeScript interfaces, C# classes, Java records, Go structs, Rust serde structs or Python dataclasses from sample JSON. Fields missing from some samples become optional.
Key-value pairs to code
Turn key=value or key: value lines into JSON, YAML, .properties, .env, TypeScript, Python, PHP, Java, C#, Go, HTML options or SQL.
URL parse and query convert
Split a URL into its parts and parameters, turn a query string into JSON, or build a query string from a JSON object.
Convert dates and time zones
Convert one date-time per line between ISO 8601, Unix time and local time in named time zones. Daylight-saving gaps and repeats are reported.