ConvertUnlimited

JSON Formatter

Format, validate, and minify JSON locally in your browser.

Local developer tool

Paste JSON and clean it up.

Beautify nested objects, minify payloads, and validate JSON with selected inputs processed locally in your browser.

Input characters: 0

What this tool does

Beautify nested objects, minify payloads, and validate JSON with selected inputs processed locally in your browser.

Privacy behavior

Selected file contents are processed locally in your browser for supported workflows. This privacy build does not intentionally load ads, analytics, remote fonts, or third-party runtime scripts.

Supported workflow

Use the controls on this page, review the output in your browser, then copy or download the result.

When should you format JSON?

Formatted JSON is easier to inspect, debug, review, and share with teammates. Minified JSON is useful when you need compact payloads for APIs, examples, or configuration files.

This tool validates strict JSON. It does not repair invalid JSON or accept JavaScript-style comments, trailing commas, or unquoted keys.

JSON grammar and what this tool enforces

JSON, defined in RFC 8259, allows exactly six value types: object, array, string, number, boolean, and null. An object is an unordered set of string-keyed pairs in curly braces; an array is an ordered list in square brackets. Strings must use double quotes, never single quotes, and support backslash escapes such as \n, \t, and \uXXXX for arbitrary code points. Numbers follow a strict grammar: an optional minus sign, an integer part with no leading zeros other than a bare 0, an optional fractional part, and an optional exponent; JSON has no literal for NaN, Infinity, or hexadecimal numbers, even though JavaScript itself accepts all three.

This tool parses input with the browser native JSON.parse(), so it enforces that grammar exactly as strictly as any production JSON parser would. Comments, trailing commas after the last array or object item, unquoted object keys, and single-quoted strings are all rejected, since none of them are part of the JSON grammar even though relaxed supersets such as JSON5 or JSONC allow them.

JSON typeAllowed formExampleParsed JavaScript type
ObjectDouble-quoted string keys only{"a":1}Object
ArrayOrdered, comma-separated, no trailing comma[1,2,3]Array
StringDouble-quoted, backslash escapes"line\n"string
NumberNo leading zeros, no NaN, no hex, no leading plus-3.14e2number, IEEE 754 double
BooleanLowercase true or false onlytrueboolean
NullLowercase null onlynullnull

Worked examples

Formatting {"a":1,"b":[1,2,3],"c":{"d":true,"e":null}} with 2-space indentation produces:

{
  "a": 1,
  "b": [
    1,
    2,
    3
  ],
  "c": {
    "d": true,
    "e": null
  }
}

Minify reverses this back to the original single-line form. A malformed input such as {"a":1,}, with a trailing comma, fails validation with a message similar to Expected double-quoted property name in JSON at position 7 in Chromium-based browsers; this tool adds its own computed line and column after that message when the browser text includes a numeric position.

Limits and gotchas

  • No auto-repair. The tool validates strict JSON and reports the parser error message; it never guesses at fixing a missing quote, an extra comma, or a stray comment.
  • Large integers lose precision. JSON numbers are parsed into JavaScript double-precision floats, which only represent integers exactly up to 9007199254740991 (2 to the 53rd power minus 1). Formatting {"id":9007199254740993} outputs {"id":9007199254740992}, silently rounding a 64-bit style ID. APIs that need exact large IDs typically send them as strings for this reason.
  • Integer-like keys get reordered. JavaScript object property order places keys that look like array indices, such as "2" or "10", in ascending numeric order before other string keys, regardless of the order they appeared in the source. Formatting {"10":1,"2":2,"a":3,"1":4} outputs {"1":4,"2":2,"10":1,"a":3}, a real reordering that has nothing to do with this tool and everything to do with how JavaScript objects behave.
  • Duplicate keys keep the last value only. Nothing in the JSON grammar forbids repeating a key in the same object, but JSON.parse() silently keeps only the last occurrence, discarding earlier values for that key without a warning.
  • Line and column detection depends on browser wording. This tool extracts a line and column by searching the browser own error message for the word position followed by a number. Chromium-based browsers include that; if a different engine phrases the error differently, the native message still appears, just without this tool own added line and column annotation.

Frequently Asked Questions

Is this JSON Formatter free?

Yes. You can format, validate, minify, copy, and download JSON without signup.

Is my JSON uploaded?

No. Parsing and formatting run locally in your browser.

Does it support Unicode and emojis?

Yes. JSON.parse and JSON.stringify preserve valid Unicode strings and emojis.

Can it fix invalid JSON?

No. It validates strict JSON and shows an error so you can fix the source manually.

What indentation should I use?

Two spaces are common for web projects, four spaces are easier to read, and tabs are useful when your project requires them.

Why did a large ID number change after formatting?

JSON numbers are parsed as JavaScript double-precision floats, which cannot exactly represent integers above 9007199254740991. A 64-bit style ID beyond that range is silently rounded; store or transmit such IDs as strings if exact precision matters.

Why are my object keys reordered after formatting?

JavaScript places keys that look like array indices, such as "2" or "10", in ascending numeric order ahead of other string keys. This reordering happens for any JSON.parse and JSON.stringify round trip, not specifically because of this tool.

Why does an error message not show a line and column?

This tool adds line and column numbers only when the browser own JSON.parse error text includes the word position and a number. Some browser engines phrase parse errors differently, so you may see only that engine native message instead.

Privacy

Privacy build: This build removes ads, analytics, remote fonts, runtime CDN scripts, and file-operation telemetry. Selected files are processed in the browser using local JavaScript and browser APIs.

ConvertUnlimited does not provide a server-side upload endpoint for this JSON formatting flow. JSON input and selected files are processed locally in your browser.

Terms of Use

ConvertUnlimited is provided as is. Always review formatted JSON before using it in production systems.

Privacy & processing

Trust and privacy

Files are processed locally where supported. Review the Trust Center for the processing model and the Privacy Policy for public-site privacy boundaries.