About the Handiwork JSON Formatter
The JSON Formatter parses input with the browser’s JSON parser and serializes the resulting value as either indented or compact JSON. A successful result confirms JSON syntax, not the meaning or schema of the data. Because parsing creates JavaScript values, large integers, duplicate member names, and exact original formatting require special care.
How to use the Handiwork JSON Formatter
- Paste JSON and review it for secrets before processing or sharing.
- Choose Beautify for two-space indentation or Minify for compact serialization.
- Check the parsed output, especially large numbers and duplicate keys, then copy it only after any required schema validation.
What validation checks
The tool uses JSON.parse, so names must be double-quoted strings, strings must use valid escapes, values must be valid JSON types, and trailing commas or comments are rejected. A syntactically valid object can still omit required fields, use the wrong units, or violate an API contract.
Beautifying and minifying both reserialize data
Beautify calls JSON.stringify with two-space indentation; Minify calls it without extra whitespace. Both operations parse first and create a new serialization. They do not merely add or remove visible spaces from the original source.
Worked syntax example
The input {"active":true,"count":3} is valid and beautifies across multiple lines. {active:true,} is not JSON because the member name is unquoted and a trailing comma is present. JavaScript object-literal syntax and JSON overlap, but they are not interchangeable.
Large integers and duplicate names
JavaScript numbers use IEEE 754 binary floating-point. Integers beyond Number.MAX_SAFE_INTEGER can lose exact precision when parsed and reserialized. If an object contains the same member name more than once, JSON.parse retains the last value. Use a lossless parser or preserve identifiers as strings when exact digits matter.
Continue this workflow
Use the adjacent tool when the next step calls for a different input, output, or method.
Assumptions and limitations
- Syntax validation does not validate a JSON Schema, API contract, data type policy, or business rule.
- Integers beyond JavaScript’s safe integer range can lose precision during parsing.
- Duplicate object member names are not reported; the last parsed value is retained.
- Comments, trailing commas, NaN, Infinity, undefined, BigInt, and JavaScript object-literal extensions are not valid JSON.
- Formatting cannot determine whether embedded URLs, credentials, personal data, or commands are safe.
Sources and standards
These authoritative references were used to verify the method and guidance on this page.
Frequently asked questions
What is the difference between JSON and a JavaScript object?
JSON is a text format with stricter syntax. For example, object member names require double quotes, and comments, trailing commas, undefined, and functions are not allowed.
Does valid JSON mean the data is correct?
No. It only means the text can be parsed as JSON. A schema or application must validate required fields, types, ranges, and meaning.
Can formatting change a large integer?
Yes. Values beyond JavaScript’s safe integer range can lose exact precision. Store such identifiers as strings or use a lossless JSON parser.
What happens to duplicate object keys?
The browser parser retains the last value for a duplicate name. This tool does not warn about duplicates before parsing.
Is my JSON uploaded?
No. Parsing and serialization run in your browser. You should still avoid exposing sensitive output through screenshots, clipboard history, or shared devices.