JSON Formatter
Format, repair, minify, validate and visualize JSON. Runs entirely on your machine
Clear structure. Easier debugging.
Input is processed in real time by the local Rust engine; your data never leaves this machine.
Input
{"name":"ToolForge","local":true,"hello":"world"}Formatted result
{
"name": "ToolForge",
"local": true,
"hello": "world"
}Before you begin
Install through the in-app tool market. Plugins update independently; review their permissions before installing.
Usage and limits
- Input is processed in real time by the local Rust engine; your data never leaves this machine.
- Format / Minify / Validate support strict JSON as well as relaxed JSON5 (comments, trailing commas, single quotes).
- Repair runs only when you click Start repair. Preview common syntax fixes, then choose Apply and format to replace the input with strict JSON. Ambiguous missing values, duplicate keys and truncated strings are rejected; the limit is 2 MiB, 127 nesting levels and 100,000 nodes.
- Errors highlight the offending line; click “Go to error” to jump there.
- JCS canonical: sorts keys by UTF-16 code units and normalizes string escapes and number formatting per RFC 8785. Only strict JSON is accepted; duplicate keys, lone surrogates and out-of-range numbers fail with a clear error.
- The tree view loads nodes on demand so large files stay smooth; stats show type counts and nesting depth.
- Compare performs a structural diff and lists added, removed and changed paths.
- Export the diff as a JSON Patch (add / remove / replace / move with JSON Pointer paths) or a JSON Merge Patch for reviews and config sync.
Input
{"name":"ToolForge","local":true,"hello":"world"}Formatted result
{
"name": "ToolForge",
"local": true,
"hello": "world"
}Need installation help?
Know what a tool can access.
These capabilities come from the tool manifest. Host authorization and the current operation still determine actual access.
Command line & AI agents
Only the functions explicitly listed below are exposed to their declared channels. Availability also depends on the app version, tool settings and user authorization.
format · Pretty-print JSON
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
mode | string | Parsing mode: strict JSON, or JSON5 allowing comments, trailing commas and single quotes |
indent | string | Indentation |
sortKeys | boolean | Sort object keys |
cat data.json | tfp-json-formatter format --indent 4minify · Minify JSON onto one line
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
mode | string | Parsing mode: strict JSON, or JSON5 allowing comments, trailing commas and single quotes |
sortKeys | boolean | Sort object keys |
cat data.json | tfp-json-formatter minifyvalidate · Validate JSON and report the first syntax error with line and column
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
mode | string | Parsing mode: strict JSON, or JSON5 allowing comments, trailing commas and single quotes |
cat data.json | tfp-json-formatter validaterepair · Repair malformed JSON (missing quotes, trailing commas, comments) and pretty-print it
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
indent | string | Indentation |
sortKeys | boolean | Sort object keys |
cat broken.json | tfp-json-formatter repaircanonicalize · Canonicalize JSON according to RFC 8785 (JCS)
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
cat data.json | tfp-json-formatter canonicalizeescape · Escape text as a JSON string literal
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
cat note.txt | tfp-json-formatter escapeunescape · Unescape a JSON string literal back to text
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
input * | string | JSON text |
cat escaped.txt | tfp-json-formatter unescapediff · List added, removed and changed paths between two JSON documents
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
left * | string | Original JSON text |
right * | string | Changed JSON text |
mode | string | Parsing mode: strict JSON, or JSON5 allowing comments, trailing commas and single quotes |
tfp-json-formatter diff "$(cat a.json)" "$(cat b.json)"diff_patch · Generate a JSON Patch (RFC 6902) or Merge Patch (RFC 7386) from two JSON documents
CLI / AI Agent · Read-only
| Parameter | Type | Description |
|---|---|---|
left * | string | Original JSON text |
right * | string | Changed JSON text |
mode | string | Parsing mode: strict JSON, or JSON5 allowing comments, trailing commas and single quotes |
kind * | string | Patch format |
tfp-json-formatter diff_patch "$(cat a.json)" "$(cat b.json)" --kind merge