JSON / FORMATTER

JSON Formatter & Validator

Paste raw JSON on the left and instantly get clean, validated output on the right. Choose indentation, sorting, Unicode escaping and repair rules. Everything runs locally, so sensitive payloads never leave your device.

JSON formatting workbench

workspace.json — live session
INDENT
SORT
01 / RAW INPUT 0 LINES · 0 B
02 / FORMATTED OUTPUT 0 LINES · 0 B
Awaiting input ⌘/CTRL + ↵ TO FORMAT
HOW IT WORKS

From pasted text to formatted output, in one pass.

Paste a minified API response into the raw input pane. The engine reads the source as text first, masking string literals so a stray quote or apostrophe inside your data can never be mistaken for structure. It then parses the value and re-serialises it under the indent, sort and line-ending rules you have selected. The output pane follows you as you type, and nothing leaves the tab to do it.

The pipeline, in order

  • ▸Repair runs before parsing. With REPAIR on, comments, trailing commas, bare keys, single-quoted strings, Python literals and leading-dot numbers are normalised — and every fix is listed in the status bar, so a rescued document is never a silent rewrite.
  • ▸The value is parsed, not retyped. Key order, duplicates and nesting are resolved into a real structure before output is produced, which is why 2.0 becomes 2 and a document can be sorted without breaking.
  • ▸Formatting is applied last. Indent 1, 2, 4, TAB or MIN, keys left alone or sorted A→Z / Z→A, optional \uXXXX escaping, LF or CRLF, and a trailing newline you can switch off.
  • ▸Your toolbar choices persist. Options, auto-format and the output lock are written to local storage, so the next paste arrives already configured for the project you are in.

What each control changes

Control Choices Effect on the result
INDENT1 · 2 · 4 · TAB · MINSpaces (or a tab) per nesting level; MIN collapses the document onto one line
SORTOFF · A→Z · Z→AObject keys at every depth. Array order is never rearranged — it is data
ESCAPE UNICODEon · offWrites café as caf\u00e9 for systems that mangle non-ASCII
TRAILING NLon · offAdds the final newline that POSIX tools and clean git diffs expect
REPAIRon · offThe umbrella switch for the recovery pass; ADVANCED exposes each individual fix
STRICT PARSEon · offParses exactly as RFC 8259 and reports the raw failure — use it to check a file you are about to commit
EOLLF · CRLFLine separator for the whole output, including the trailing newline

One paste, two results

REPAIR ON · INDENT 2
in   { name:'bracekit', tags:['json','tools',], version:2.0 }
out  {
  "name": "bracekit",
  "tags": [
    "json",
    "tools"
  ],
  "version": 2
}

Three ways to read the same value

The input pane switches between TEXT and TREE; the output pane adds TABLE, which flattens an array of objects into columns so a four-hundred-record export can be skimmed like a spreadsheet. The ✎ EDIT button makes the formatted pane editable, so you can fix a document where it already is instead of pasting it back into the left side. The footer keeps the running count of keys, arrays, size and how long the last pass took.

If a document will not parse, the status bar reports the derived line and column rather than a bare character offset — Line 7, column 24: Expected ',' or '}' after property value. The parse-error guide walks through what each message means and the invisible characters that break an otherwise valid file.

NOTE Files up to 12 MB open from disk or by drag-and-drop, and nesting deeper than 2,000 levels stops with a depth error instead of hanging the tab. Conversions, JSONPath, schema generation, diff and find live on the full workbench and on each tool page.

  • ▸Live dual-pane editing with text, tree and table views
  • ▸Validation with line and column error reporting
  • ▸Repair comments, trailing commas, bare keys and Python literals
  • ▸Sort keys, escape Unicode, configure line endings and trailing newlines
  • ▸Copy, download, print and open JSON files locally

No account, no upload queue and no server-side parsing: the whole formatter ships as static files, so the page loads fast, caches well and keeps working when the network does not.

ANSWERS

Frequently asked questions

Is my JSON data uploaded to a server?

No. Parsing, formatting, conversion, validation and comparison all run in your browser with JavaScript. Your data is never transmitted, and history is stored only in your local storage.

How do I fix invalid JSON with comments or trailing commas?

Keep Repair enabled. bracekit strips line and block comments, removes trailing commas, quotes unquoted keys and converts Python-style literals before validation.

What indentation options are supported?

You can choose 1, 2 or 4 spaces, tabs, or compact single-line output. You can also sort object keys, escape Unicode, switch line endings and control the trailing newline.

Can I convert JSON to YAML, CSV or XML?

Yes. The advanced module converts JSON to YAML, CSV, XML, query strings, Base64, NDJSON and TypeScript, and every one of those except TypeScript also converts back.

Does it support JSONPath queries?

Yes. The Query module supports dot notation, bracket notation, array indexes, wildcards, recursive descent and filters such as @.price > 10.

TOOL MATRIX

More JSON tools

Keyboard shortcuts
FORMATTING
Format input Ctrl/⌘ + Enter
Toggle auto-format Ctrl/⌘ + Shift + A
CLIPBOARD & FILES
Copy output Ctrl/⌘ + K
Open JSON file Ctrl/⌘ + O
Download output Ctrl/⌘ + S
Save snippet Ctrl/⌘ + Shift + N
MODULES
Open find & replace Ctrl/⌘ + Shift + F
Lock / unlock output Ctrl/⌘ + Shift + L
Show this dialog Ctrl/⌘ + /
Local history
Save snippet
Erase local data

Nothing is stored in this browser yet.

Removes the saved draft, history, snippets and formatting options for this site. Documents you typed stay in the editor until the page reloads.