Skip to content

Data and security

JSON formatter, validator and fixer

Paste JSON and press Format to pretty-print it, Minify to compact it, or Validate to check it. Errors show the line and column. Tick "Try to repair" to fix common mistakes such as trailing commas, comments, single quotes and unquoted keys. Everything happens in your browser, so private data never leaves your device.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up
  • No ads

How to format and validate JSON

  1. Paste your JSON. Paste it into the left box. It can be minified, messy or copied from a log or API response.
  2. Choose an action. Format makes it readable, Minify makes it compact, Validate only checks it without changing it.
  3. Read the message. If it is invalid the message gives the line and column of the problem. With repair on, fixable mistakes are corrected and listed.
  4. Copy or download. Copy the result or save it as a .json file.

What counts as valid JSON

JSON is a strict text format used by web APIs, configuration files and data exports. A valid document is one value: an object in curly braces with double-quoted keys, an array in square brackets, a string, a number, true, false or null. Values and entries are separated by commas, and there must be no comma after the last item. Comments are not allowed. These strict rules are why a hand-edited file so often "fails to parse".

The mistakes people actually make

MistakeExampleFix
Trailing comma{"a": 1,}Remove the last comma
Single quotes{'a': 'b'}Use double quotes
Unquoted keys{a: 1}Write {"a": 1}
Comments// noteRemove them; JSON has none
Python or JavaScript valuesTrue, None, undefined, NaNUse true, null
Missing comma{"a":1 "b":2}Add a comma between entries
Unescaped quote or newline in a string"say "hi""Write \"hi\" and \n

With "Try to repair" on, the tool fixes trailing commas, single quotes, unquoted keys, comments and Python-style values, and tells you what it changed. It does not guess at missing commas, brackets or broken strings: for those it reports the position so you can fix them yourself. A repaired document is valid JSON, but check that the repair is what you meant.

Why a private formatter matters

JSON often carries API keys, customer records, tokens or logs. Pasting them into an online formatter that uploads them is a real risk. This tool parses and formats in your browser, with no network request containing your text.

Format, minify and sort

  • Format adds line breaks and indentation so that structure is visible.
  • Minify removes all whitespace to make the payload as small as possible for sending or storing.
  • Sort keys orders every object's keys alphabetically, which makes two JSON files easier to compare in the text diff checker.

Limits

  • Very large files (tens of megabytes) can be slow on a phone.
  • JavaScript reads numbers as 64-bit floats, so integers above 9,007,199,254,740,991 lose precision. If you handle large IDs, keep them as strings.
  • Duplicate keys in an object keep only the last value.
  • Key order is preserved except when you sort.

Need a spreadsheet? Convert between JSON and CSV in the CSV and JSON converter.

Frequently asked questions

How do I find the error in my JSON?

Press Validate only or Format with repair off. The message shows the line and column where the parser stopped, which is usually at or just after the mistake.

Why does JSON not allow comments or trailing commas?

The format is intentionally minimal (RFC 8259) so every program reads it the same way. Some tools accept extensions such as comments, but standard JSON does not.

Can this fix JSON copied from Python or JavaScript?

Often yes. With repair on, single quotes, unquoted keys, trailing commas, comments, True, False, None and undefined are converted. Structural errors such as a missing bracket are reported, not guessed.

Is my JSON uploaded?

No. It is parsed and formatted in your browser tab.

What is the difference between formatting and minifying?

Formatting adds spaces and line breaks for people to read. Minifying removes them to make the file smaller. The data is identical.

Why did a big number change?

JavaScript stores numbers as 64-bit floating point, so integers above 9,007,199,254,740,991 lose digits. Store such IDs as strings.

Sources and how we checked

Written and maintained by the DanixSoft team in Lahore. Last reviewed 2026-11-22. Spotted a mistake? Write to hello@danixsoft.com.