RootUtils

JSON Formatter

Client-Side Secure

Free online JSON formatter and validator. Beautify or minify JSON, fix common formatting issues with JSON5, browse in Tree View, filter with.S queries — all client-side.

Input JSON
Result

Waiting for valid JSON

Is this tool broken?

Let us know if you found a bug or have a feature request.

JSON Formatter & Validator (Client-Side) — Beautify, Minify, Search, Tree View, JSON5, and Fix JSON

RootUtils JSON Formatter helps you work with JSON faster: validate if your JSON is correct, beautify messy responses, minify output for production, search inside large payloads, and explore nested objects using an interactive Tree View. Everything runs locally in your browser, so your data stays on your device.

This tool is designed for real-world JSON: API responses, configuration files, analytics events, logs, and exported data. Paste JSON into the editor, import a file, or drag and drop a .json file — the output updates instantly when the input is valid.

How to Use the Tool

  • Paste or Import: Paste JSON into the “Input JSON” panel, click Import to load a file, or drag and drop a JSON file into the editor. If the JSON is invalid, the tool shows an error so you know the input needs fixing.
  • Beautify (Expand icon): Click Beautify to format JSON with indentation and line breaks. This makes large responses readable and easier to debug.
  • Minify (Compress icon): Click Minify to remove whitespace and produce compact JSON. This is useful for copying into configs, testing payload size, or sending minimal data.
  • JSON5 Toggle: Turn on JSON5 when your input is not strict JSON (for example: comments, trailing commas, single quotes, or unquoted keys). When JSON5 is enabled, the tool can parse these relaxed formats in the browser.
  • Fix JSON (wand icon): If you paste messy JSON-like content, click Fix JSON. This attempts to repair common mistakes (such as trailing commas or JSON5-style input) and converts it into strict JSON you can safely copy or export.
  • Tree / Code: Use Code View for formatted text (with syntax coloring on smaller outputs). Switch to Tree View to expand/collapse objects and arrays — especially helpful for deeply nested structures.
  • Copy / Export: Click Copy to copy the formatted result as JSON. Click Export to download the result as a JSON file. Use the CSV button to export data when your JSON is an array of objects (or a simple object) into a spreadsheet-friendly format.

Filter Bar: Search Text or Run JavaScript Queries

The Filter bar has two modes:

  • Text Search: Type a word like active or email and press Enter (or click Apply) to reduce the output to only matching parts. This is useful when you are hunting for a specific field in a huge response.
  • JavaScript Query: If you start with data (or use a JS expression), the filter runs as a JavaScript query against your JSON. The variable data represents your parsed JSON.

JavaScript Query Examples

  • data.users.filter(u => u.active) — show only active users.
  • data.items.map(i => i.id) — extract just a list of IDs.
  • data.response.payload.results — jump directly to a nested path.

Privacy and Common Questions

Is my JSON uploaded to a server?

No. This formatter runs in your browser. Your text is processed locally on your device.

Can I convert JSON to CSV for Excel?

Yes. Use the CSV button. CSV export works best when the JSON is an array of objects or a simple object.

What if my JSON is invalid?

The tool will show an invalid JSON error. You can correct the input manually, enable JSON5 if the format is relaxed, or try the Fix JSON button to convert common JSON-like input into strict JSON.