[{"data":1,"prerenderedAt":339},["ShallowReactive",2],{"tool-content-en-json-formatter":3},{"id":4,"title":5,"body":6,"description":329,"extension":330,"locale":331,"meta":332,"navigation":333,"path":334,"seo":335,"stem":336,"toolId":337,"__hash__":338},"tools\u002Ftools\u002Fen\u002Fjson-formatter.md","JSON Formatter",{"type":7,"value":8,"toc":314},"minimark",[9,14,23,27,60,64,70,229,240,251,254,258,269,273,276,280,285,294,298,307,311],[10,11,13],"h2",{"id":12},"what-is-json-formatting","What is JSON formatting?",[15,16,17,18,22],"p",{},"JSON formatting parses raw JSON and applies consistent indentation and line breaks to make it easier to read. This tool can also remove unnecessary whitespace to produce compact JSON, and it can repair the syntax mistakes that stop ",[19,20,21],"code",{},"JSON.parse"," from accepting an otherwise complete document.",[10,24,26],{"id":25},"how-to-use-it","How to use it",[28,29,30,38,41,57],"ol",{},[31,32,33,34,37],"li",{},"Paste JSON into the editor, or upload a ",[19,35,36],{},".json"," file.",[31,39,40],{},"Choose two or four spaces for indentation.",[31,42,43,44,48,49,52,53,56],{},"Select ",[45,46,47],"strong",{},"Format"," for readable output, ",[45,50,51],{},"Minify"," for compact output, or ",[45,54,55],{},"Repair"," to fix broken JSON.",[31,58,59],{},"Copy the result when you are done.",[10,61,63],{"id":62},"repairing-broken-json","Repairing broken JSON",[15,65,66,67,69],{},"JSON that a server or browser rejects is often one character away from valid. ",[45,68,55],{}," parses the document leniently, applies the fixes below, and reports which ones it applied.",[71,72,73,89],"table",{},[74,75,76],"thead",{},[77,78,79,83,86],"tr",{},[80,81,82],"th",{},"Problem",[80,84,85],{},"Example",[80,87,88],{},"Result",[90,91,92,106,119,136,151,166,183,199],"tbody",{},[77,93,94,98,103],{},[95,96,97],"td",{},"Missing comma",[95,99,100],{},[19,101,102],{},"{\"a\": 1 \"b\": 2}",[95,104,105],{},"Inserts the comma",[77,107,108,111,116],{},[95,109,110],{},"Trailing comma",[95,112,113],{},[19,114,115],{},"{\"a\": 1,}",[95,117,118],{},"Removes it",[77,120,121,124,133],{},[95,122,123],{},"Comments",[95,125,126,129,130],{},[19,127,128],{},"\u002F\u002F note"," or ",[19,131,132],{},"\u002F* note *\u002F",[95,134,135],{},"Removed",[77,137,138,141,146],{},[95,139,140],{},"Unquoted keys",[95,142,143],{},[19,144,145],{},"{id: 1}",[95,147,148],{},[19,149,150],{},"\"id\": 1",[77,152,153,156,161],{},[95,154,155],{},"Single-quoted strings",[95,157,158],{},[19,159,160],{},"{'a': 'b'}",[95,162,163],{},[19,164,165],{},"\"a\": \"b\"",[77,167,168,173,178],{},[95,169,170],{},[19,171,172],{},"undefined",[95,174,175],{},[19,176,177],{},"{\"a\": undefined}",[95,179,180],{},[19,181,182],{},"null",[77,184,185,188,193],{},[95,186,187],{},"Raw newlines in strings",[95,189,190],{},[19,191,192],{},"\"line1⏎line2\"",[95,194,195,196],{},"Escaped as ",[19,197,198],{},"\\n",[77,200,201,204,219],{},[95,202,203],{},"Python literals",[95,205,206,209,210,209,213,209,216],{},[19,207,208],{},"True",", ",[19,211,212],{},"False",[19,214,215],{},"None",[19,217,218],{},"NaN",[95,220,221,209,224,209,227],{},[19,222,223],{},"true",[19,225,226],{},"false",[19,228,182],{},[15,230,231,232,235,236,239],{},"Repairs are applied in the course of parsing rather than by rewriting the text, so a ",[19,233,234],{},"\u002F\u002F"," inside a string such as ",[19,237,238],{},"\"https:\u002F\u002Fexample.com\""," is never mistaken for a comment. When the input is already valid, the result is identical and the tool says no repairs were needed.",[15,241,242,243,246,247,250],{},"A missing comma is restored automatically because the intended structure is unambiguous. A ",[45,244,245],{},"missing colon"," is not: in ",[19,248,249],{},"{\"a\" 1}"," it is unclear whether the colon was dropped or two values were intended, so the tool still reports an error rather than guess.",[15,252,253],{},"Uploading a file falls back to the repair pass automatically when the file is not strictly valid JSON, so a slightly broken export still loads.",[10,255,257],{"id":256},"filtering-with-jsonpath","Filtering with JSONPath",[15,259,260,261,264,265,268],{},"The search icon next to ",[45,262,263],{},"JSON"," opens a JSONPath bar. Type an expression such as ",[19,266,267],{},"$.list[*].title"," to extract matching values from the document without hand-writing a script. The expression runs against the JSON currently in the editor.",[10,270,272],{"id":271},"privacy-and-security","Privacy and security",[15,274,275],{},"Your input is processed directly by JavaScript in your browser and is never sent to a server. The tool does not intentionally persist input after you close or refresh the page.",[10,277,279],{"id":278},"frequently-asked-questions","Frequently asked questions",[281,282,284],"h3",{"id":283},"why-does-json-validation-fail","Why does JSON validation fail?",[15,286,287,288,290,291,293],{},"Common causes include unquoted property names, missing or trailing commas, single-quoted strings, ",[19,289,172],{}," values, or unescaped characters inside strings. Most of these are fixed by ",[45,292,55],{},".",[281,295,297],{"id":296},"does-formatting-or-repairing-change-my-data","Does formatting or repairing change my data?",[15,299,300,301,303,304,306],{},"Formatting only changes whitespace and indentation. Repairing changes what was already malformed: ",[19,302,172],{}," and Python literals become ",[19,305,182],{},", and missing separators are inserted. Objects, arrays, strings, numbers, and booleans keep their original meaning.",[281,308,310],{"id":309},"is-my-json-sent-anywhere","Is my JSON sent anywhere?",[15,312,313],{},"No. Every operation, including the lenient parse used by Repair, runs locally in your browser.",{"title":315,"searchDepth":316,"depth":316,"links":317},"",2,[318,319,320,321,322,323],{"id":12,"depth":316,"text":13},{"id":25,"depth":316,"text":26},{"id":62,"depth":316,"text":63},{"id":256,"depth":316,"text":257},{"id":271,"depth":316,"text":272},{"id":278,"depth":316,"text":279,"children":324},[325,327,328],{"id":283,"depth":326,"text":284},3,{"id":296,"depth":326,"text":297},{"id":309,"depth":326,"text":310},"Format, minify, repair and validate JSON online for free. All data is processed locally in your browser.","md","en",{},true,"\u002Ftools\u002Fen\u002Fjson-formatter",{"title":5,"description":329},"tools\u002Fen\u002Fjson-formatter","json-formatter","dBagBUkHRbAgBB0A4rt-x1L11-gGV4_Ez3kRXZJaghc",1792391418654]