Runs 100% in your browser — your JSON is never uploaded

JSON Beautifier & Formatter

Paste JSON to beautify, validate and minify it. Errors are shown with their exact line and column, broken JSON can be repaired in one click, and the result opens as code, an editable tree, a form or a read-only view.

Beautify, validate and minify JSON

Input

Loading editor…

Output

Formatted JSON will appear here.

No output yet

Ctrl/⌘+Enter Beautify Ctrl/⌘+Shift+Enter Minify Esc Exit full screen Drop a .json file anywhere on the tool to open it

In short: what this JSON beautifier does

The SeeB4Coding JSON Beautifier & Formatter is a free online tool that formats, validates, minifies and repairs JSON entirely inside your browser. Paste or drop a file, click one button, then copy or download the result. There is no sign-up and nothing is uploaded.

  • Beautify and minify: pretty-print with 2, 3 or 4 spaces or tabs, or compress to one line.
  • Precise validation: syntax errors are reported with line, column and a plain-English reason, with a jump-to-error button.
  • One-click repair: fixes trailing commas, single quotes, unquoted keys, comments, missing commas and Python literals.
  • Lossless formatting: key order, string escapes and big integers such as 9007199254740993 are kept exactly.
  • Extra tools: recursive key sorting, escape to a string literal, unescape stringified JSON.
  • Four views: code, editable tree with search, form and read-only view.
  • Privacy: processing is client-side JavaScript; your JSON never leaves the device.

How to beautify and validate JSON

Three steps, usually under a minute.

Add your JSON

Paste JSON into the Input panel, drop a .json file onto it, upload a file or load the sample. The status bar validates as you type and shows the exact line and column of any syntax error.

Fix errors if needed

Click Go to error to jump to the problem, or click Repair to fix trailing commas, single quotes, unquoted keys, comments and missing commas automatically.

Beautify, minify or sort

Choose an indentation and click Beautify, Minify or Sort keys. Explore the result as code, tree, form or view, then copy it or download a .json file.

Which action should you use?

Every action reads the Input panel and writes to the Output panel, except Repair, which fixes the input in place.

What each button does and when to use it.
Action Example result Use it when
BeautifyEach key on its own indented lineReading an API response, reviewing config, preparing JSON for a commit or a code review.
Minify{"id":1,"tags":["a","b"]}Sending JSON in a request body, storing it in a database column or cutting payload size.
Sort keys{"a":…,"b":…,"c":…} at every levelComparing two responses or config files, or producing stable, diff-friendly output.
Repair{a:'x',} → {"a":"x"}Pasting a JavaScript object literal, JSON with comments, Python output or text from an AI chat.
Escape"{\"id\":1}"Embedding JSON inside another JSON string field, an environment variable or source code.
Unescape"{\"id\":1}" → {"id": 1}Reading JSON that was stored as a string in logs, message queues or database values.

Common JSON errors and how to fix them

JSON is stricter than JavaScript. These are the mistakes the validator reports most often.

Invalid JSON, the corrected form, and whether the Repair button fixes it automatically.
Problem Invalid Valid Repair fixes it
Trailing comma{"a": 1,}{"a": 1}Yes
Single quotes{'a': 'b'}{"a": "b"}Yes
Unquoted property name{a: 1}{"a": 1}Yes
Comments{"a": 1 /* note */}{"a": 1}Yes
Missing comma{"a": 1 "b": 2}{"a": 1, "b": 2}Yes
Python literals{"a": True, "b": None}{"a": true, "b": null}Yes
Line break inside a string"line 1↵line 2""line 1\nline 2"Yes
Unclosed bracket{"a": [1, 2{"a": [1, 2]}Yes
NaN or undefined{"a": NaN}{"a": null}Partly — becomes the string "NaN"
Leading zeros{"a": 007}{"a": 7}No — edit by hand

Repair guesses what you meant. Always check the repaired input before using it, especially for values that were cut off or unquoted.

Built for everyday JSON work

Useful whether you are debugging an API, editing config or cleaning up output from an AI model.

Formatting that never changes data

The formatter rebuilds text from the original tokens instead of round-tripping through JavaScript numbers, so IDs above 2^53 and escapes like \u00e9 stay exactly as written.

Tree editing with search

Switch the output to Tree to collapse large responses, search keys and values, drag nodes, sort arrays or run a transform query, then copy the result.

Nothing to lose

Your input is saved as a draft on this device, the last 20 formatted inputs are in History, and dark mode, indentation, view and wrap settings are remembered.

Frequently asked questions

Answers to the questions people ask most about formatting and validating JSON.

Is my JSON uploaded to a server?

No. Formatting, validation and repair all run in your browser with JavaScript, so your JSON never leaves your device. The editor panels are also masked from analytics session recordings.

What is the difference between beautify and minify?

Beautify adds line breaks and indentation so JSON is easy to read and review. Minify removes all optional whitespace so the same data is as small as possible for network requests and storage. Both keep the data identical.

How do I find the error in invalid JSON?

The status bar under the Input panel validates as you type and reports the line, the column and a plain-English reason, such as a trailing comma or a property name without double quotes. Click Go to error to move the cursor to that position.

What does Repair JSON fix?

Repair fixes trailing commas, single quotes, curly quotes, unquoted property names, JavaScript comments, missing commas, Python True, False and None, unescaped line breaks inside strings, missing closing brackets and JSONP wrappers. NaN and undefined are turned into strings, and numbers with leading zeros are not repaired. Always review the result.

Does beautifying change my data?

No. Beautify, Minify and Sort keys rebuild the text from the original tokens, so key order, string escapes and large integers such as 9007199254740993 are kept exactly in the Code output. Only Sort keys changes the order of object keys. Tree, Form and View use JavaScript numbers, so integers larger than 253 may be rounded in those views.

How do I sort JSON keys alphabetically?

Click Sort keys. Object keys are sorted A to Z at every nesting level and the result is beautified with your chosen indentation. The order of items inside arrays is not changed, because array order is part of the data.

What do Escape and Unescape do?

Escape minifies your JSON and wraps it in a JSON string literal, escaping quotes and backslashes, so it can be embedded in another JSON field, an environment variable or source code. Unescape does the reverse: it takes stringified JSON such as a log line or database value and returns the formatted object.

What are the Code, Tree, Form and View modes?

Code is an editable text editor with syntax highlighting and folding. Tree is an editable, collapsible outline with search, where you can add, remove, move and sort nodes. Form lets you edit values but not the structure. View is read-only, which is useful for exploring large responses safely.

How large a JSON file can I format?

Files up to 10 MB can be loaded. Formatting a few megabytes takes well under a second on a modern device, while the Tree, Form and View modes are slower on very large documents, so use Code output for big files.

Is my work saved?

Your current input is saved as a draft in this browser and restored when you come back, and the last 20 inputs you formatted are kept in the History panel. Both use localStorage on your device only and can be cleared at any time.

Is the JSON Beautifier free?

Yes. It is completely free, needs no sign-up and has no daily usage limit.

Other browser-based utilities from SeeB4Coding.