GetFixMyFile

JSON Formatter

Paste JSON to format with indentation, minify, or validate syntax. Errors show the parse message. Processing is local — nothing is uploaded.

Format, minify, validate

Pretty-print or minify JSON and surface parse errors. Processing stays in your browser.

Count words in prose with the word counter.

Frequently Asked Questions

What the JSON formatter actually checks

Paste a JSON value and choose Format or Minify. Format runs JSON.parse, then JSON.stringify with two-space indentation. Minify uses JSON.stringify with no extra space. Both paths fail on the same syntax errors, and the red box shows the engine message, such as "Expected double-quoted property name in JSON at position 28". The formatter does not sort keys, rename fields, or drop unknown properties. String keys keep the order JSON.parse produced.

A trailing comma is invalid. {"city":"Raipur",} fails. Comments (// or /* */) fail. Single quotes fail: {'city':'Raipur'} is JavaScript, not JSON. A bare undefined is not a JSON value. Duplicate keys are allowed by the parser and the last one wins, so {"fee":100,"fee":250} becomes {"fee":250}. Numbers are parsed as IEEE numbers: 1.0 is written back as 1, and a very large integer can lose precision. This page does not validate a JSON Schema, so a missing "email" field is still "valid JSON".

Example. Input {"name":"Asha","city":"Raipur","fees":2500} formats as a two-space object and minifies back to one line with the same three fields. If you copied the object from a JavaScript file, replace single quotes and delete the trailing comma before you format it. The Clear button wipes both boxes. Copy is available only after a successful format or minify. A pretty-printed object is easier to diff in the text diff tool. A minified object is what you paste into a query parameter or a log line where spaces are waste.

How to use it

  1. Paste the payload into Input. The sample object is only a starting point.
  2. Choose Format for reading, or Minify for a query string or a log line.
  3. If a red error appears, fix the position it names and run the same button again.
  4. Copy the output. Formatting does not change string values, only whitespace.

The text stays in this browser tab. GetFixMyFile does not upload it, store it, or include it in analytics.

Questions

Does formatting change numbers or key order?
Key order follows JSON.parse. Integer-looking values such as 10.0 are written as 10. Strings, including numeric strings, stay quoted and unchanged.
Why does my JavaScript object fail?
JSON requires double quotes and forbids trailing commas and comments. An object that is legal in a .js file is often illegal here until those three things are removed.
Can this check that required fields are present?
No. It only checks that the text is JSON. A schema, an API contract, or a form rule is a separate check.