JSON formatting workspace
Format or minify strict JSON, sort object keys, and encode or decode strings while preserving raw number tokens.
- 1Add input
- 2Adjust settings
- 3Get your result
Tool input and files are processed in this browser without being uploaded.
Before you start
Choose one document task: format or minify, recursively sort keys, encode literal text as a JSON string, or decode a JSON string to text. JSON presentation keeps original number tokens, including 9007199254740993, -0 and 1e400.
How to use this tool
- Choose a task. For JSON presentation choose formatted or compact output and, when formatting, 2 spaces, 4 spaces or tabs.
- Paste the task input or select one UTF-8 file. A selected file takes priority over the paste.
- Process the document. Inspect the bounded preview or escaped preview, then copy or download the complete result.
Supported inputs and limits
Paste up to 1 MiB or choose one UTF-8 file up to 10 MiB. A selected file replaces the paste. Filenames are limited to 512 UTF-8 bytes.
Each parsed document may contain at most 200,000 values at value depth 128; the root has depth zero. The complete output is limited to 20 MiB.
Strict JSON uses unique decoded keys. Comments, trailing commas and non-scalar Unicode strings are refused. At most one leading BOM is ignored for JSON parsing and remains part of source identity.
String encoding treats input literally, including leading BOM characters; it requires nonempty text. Decoding accepts a JSON string only, and "" produces an empty file. Layout and indentation are inactive in both string tasks.
Preview shows at most 4,000 Unicode characters. Copy and download include the complete output. Sorting follows UTF-16 key order and keeps arrays ordered; it is a presentation transform.
Processing stays in this browser and has a 10-second Worker deadline. Cancelling or a failure yields no partial new output.
Worked example
Example input
{"n":9007199254740993,"a":[1,2]}Example options
{}Example output
{
"n": 9007199254740993,
"a": [
1,
2
]
}When something does not work
Correct the reported source or controls and run again. Reduce input depth, values or output expansion when a budget is exceeded. After cancellation or the 10-second deadline, the same input can be processed in a fresh Worker.
Frequently asked questions
Where are the combined operations?
Task groups format/minify, key sorting and string encoding/decoding in one workspace. Layout is active for formatting and sorting; indentation is active only for formatted output. String tasks disable both controls.
Are my files uploaded?
No. Files and tool input are processed in your browser. Moving around the site can keep a temporary workspace in the same tab. Refreshing or closing the tab clears it, so download results you want to keep.
Does formatting validate my data model?
Syntax checking does not check field meaning or a business schema. Raw JSON number tokens remain intact; a downstream application may still use different numeric precision. Duplicate decoded keys and lone surrogate strings are refused by this interoperability profile.
Can I use formatted JSON for signature checks?
Use formatting to inspect a response, but retain the original signed message. Whitespace, line endings and field order can change the bytes used by a signature.
What happens to empty or invisible decoded text?
Decoding "" succeeds with a zero-byte TXT file. Tabs, CR/LF and a decoded leading U+FEFF remain data. The escaped preview helps inspect those characters; copy and download retain the original decoded text.
Documentation & further reading
Related tools
Regex tester
Try a pattern and see what it matches in your text.
Compare text
See what changed, side by side.
HTML formatter
Format HTML indentation so its structure is easier to read.
CSS formatter
Tidy the indentation and line breaks in your CSS.