JSON Formatter

Pretty-print JSON with configurable indentation โ€” right in your browser, no signup required.

Runs entirely in your browser. Your JSON never leaves your device.
Processing โ€” Formatโ€ฆ
Indent:
Input
Virtualized view โ€” large input is read-only. Only visible lines are rendered.
Output
Virtualized view โ€” only visible lines are rendered for performance.
Paste JSON to begin

How to use

Keyboard shortcuts
  1. Paste your JSON Type, paste, or drag and drop a JSON file into the input editor.
  2. Choose an action Switch between Format, Validate, Minify, and Lint using the tabs above.
  3. Copy the result Click Copy or use Ctrl+Shift+C to copy the output to your clipboard.
  • Run active action โ€” Ctrl+Enter
  • Format โ€” Ctrl+Shift+F
  • Validate โ€” Ctrl+Shift+V (editor focus)
  • Minify โ€” Ctrl+Shift+M
  • Lint โ€” Ctrl+Shift+L
  • Copy output โ€” Ctrl+Shift+C
  • Clear input โ€” Ctrl+Shift+K

Lint rule explainers

LINT_DUPLICATE_KEY

Two properties in the same object use the same key. Most parsers keep the later value, which can hide bugs in copied API payloads and config files.

LINT_TRAILING_COMMA

Trailing commas are common in JavaScript and JSON5, but strict JSON rejects them. Remove the comma before the closing brace or bracket.

LINT_LINE_COMMENT

JSON does not support // comments. If you need comments, switch to a JSONC or JSON5-compatible parser instead of strict JSON.

LINT_BLOCK_COMMENT

Block comments are not valid JSON. Remove them or convert the file to a format that explicitly supports comments.

LINT_SINGLE_QUOTED_STRING

Strict JSON requires double-quoted strings and keys. Single-quoted strings usually mean the input is JSON5 or a JavaScript object literal.

LINT_UNQUOTED_KEY

Object keys must be quoted in JSON. Unquoted keys are allowed in JavaScript object literals and JSON5, but not in RFC 8259 JSON.

LINT_BOM

A byte-order mark at the start of the file can confuse downstream tools. Removing it is a safe normalization step.

LINT_CONTROL_CHAR_IN_STRING

Unescaped control characters inside strings can break parsing and transport. Escape them explicitly or remove them.

LINT_EMPTY_INPUT

Empty input does not contain JSON to check. Paste a payload, config, or response body before running lint.

LINT_LOOKS_LIKE_JSON5

This advisory groups comment, quote, and trailing-comma patterns that suggest the input is JSON5-like rather than strict JSON.

Runs entirely in your browser. Your JSON never leaves your device. Last updated: 2026-05-03 About ToolMatic
What indentation should I use โ€” 2 spaces, 4 spaces, or tab?

It depends on your team's style guide. 2 spaces is the most common default in JavaScript/TypeScript projects. 4 spaces is popular in Python and Java. Tabs let each developer set their own display width. This formatter remembers your last choice.

Does this formatter work offline?

Yes. Once this page is loaded, all formatting happens in your browser using JavaScript. You can disconnect from the internet and it will continue to work.

Can it sort keys alphabetically?

Sort keys is planned for v1.1. For now, the formatter preserves the original key order from your input.

What is the maximum file size?

The formatter handles files up to 50 MB. Files under 2 MB process instantly. Files between 2-10 MB show a working indicator. Files over 10 MB use a background worker with a cancel button to keep the page responsive.

Does it preserve number precision?

The formatter preserves all JSON values exactly as the browser's JSON parser reads them. For very large integers (beyond 2^53), standard JSON parsing may lose precision โ€” this is a limitation of JavaScript, not the formatter.

How does it handle deeply nested JSON?

Deeply nested JSON is formatted normally with the selected indentation at every level. Very large deeply-nested payloads (>10 MB) use a background worker and virtualized rendering.