← All guides

How to use JSON Formatter & Converter

Format · validate · convert · compare · tree · Open JSON Formatter

This guide shows how to use ToolsViewer's JSON Formatter & Converter as a JSON formatter, validator, editor, viewer, sorter, stringify tool, and converter (XML, CSV, TSV, YAML, string) — plus compare, tree outline, flatten, URL import, and size checks — privately in your browser.

1. Overview

JSON Formatter & Converter is a free browser tool for reading, editing, validating, comparing, and converting JSON. Paste data, pretty-print or minify, convert to XML / CSV / TSV / YAML / string, compare two documents, browse a tree outline, then download the result. Core work runs on your device.

Best for: cleaning API responses, validating payloads, exporting tabular data, escaping JSON strings, and spotting structural diffs between two JSON blobs.
Not for: full JSONPath/jq querying, server-side transforms at scale, or full language runtimes. Code generators are best-effort helpers for common shapes.
JSON Formatter & Converter workspace overview
JSON Formatter overview — editor, format / convert / compare modes

2. All features

Everything below is available in the same workspace — use the mode toggle (Format / Convert / Compare) and toolbar actions.

JSON tools

  • JSON Formatter / Pretty Print / Editor / Viewer / Reader / Parser — edit in Ace, format with indent, and read structured output.
  • JSON Validator — Validate reports syntax errors with line/column when available.
  • JSON Minify / One line — compress whitespace for shipping payloads.
  • JSON Stringify Online — escape the whole document as a JSON string literal; Parse string unwraps it.
  • JSON Sorter — Sort keys recursively.
  • JSON Compare — structural path-level diff.

Converters

  • JSON → XML
  • JSON → CSV
  • JSON → TSV
  • JSON → YAML
  • JSON → String (escaped)

Unique extras

  • Tree outline — collapsible object/array browser.
  • Flatten / Unflatten — path → value maps.
  • Strip nulls — remove null fields recursively.
  • Size calculator — pretty vs minified bytes.
  • Import URL — fetch public CORS-enabled JSON.
  • Also: Python / JS / JSONL / CSV / XML → JSON, plus TypeScript, C#, Java, and Lua exports.

3. Workspace layout

The interface focuses on a few key parts:

  • Modes — Format, Convert, or Compare.
  • Editor — paste or edit input (JSON A in Compare).
  • Output / JSON B / Tree / Diff / Size — result tabs for text, outline, compare report, and stats.
  • Actions — Format/Convert/Compare, Minify, Validate, Sort, Stringify, Flatten, Download.
JSON formatter workspace layout with editor and controls
Workspace layout — paste data, choose mode, run actions

4. Format, minify & validate

Use Format to pretty-print valid JSON with indentation. Use Minify for one-line JSON. Validate confirms syntax and surfaces line/column errors when available.

  • Fix trailing commas, quotes, and unquoted keys first.
  • For Python literals or JS object pastes, set the matching input format instead of forcing strict JSON.
  • See also JSON formatter online and validate JSON online.
Pretty-printed JSON after using Format in the JSON formatter
Format — pretty-print JSON and catch syntax errors

5. Converters (XML, CSV, TSV, YAML, string)

Open Convert, keep From as JSON, pick a To format, then run Convert. Built-in converters include:

  • JSON to XML — element tree from objects / arrays.
  • JSON to CSV — tabular rows from object arrays.
  • JSON to TSV — tab-separated export for sheets.
  • JSON to YAML — indented YAML document.
  • JSON to String — escaped JSON string literal (stringify online).

Extra outputs: TypeScript interfaces, C# / Java classes, Lua tables, JS / Python literals, and plain text. Format mode also accepts Python, JSONL, CSV, and XML as inputs into JSON.

JSON converter with XML CSV TSV YAML and string outputs
Convert — JSON to XML, CSV, TSV, YAML, string, and more

6. Compare, tree & unique extras

Compare mode places JSON A on the left and JSON B on the right. Run Compare to open the Diff tab with a path-level report (+ added, − removed, ~ changed).

Use the Tree tab for a collapsible outline (viewer). Stringify / Parse string handle escaped JSON strings. Flatten / Unflatten turn nested documents into path maps and back. Sort keys and Strip nulls tidy payloads before export.

JSON compare mode with structural diff report
Compare — structural differences between two JSON documents
JSON tree outline viewer in the results panel
Tree — collapsible outline of objects and arrays

7. Import URL & download

Import URL fetches a public http(s) JSON or text resource from your browser. The remote host must allow CORS; private or blocked APIs will fail in the browser for security reasons. Tools Viewer does not proxy or store that content on our servers.

After formatting or converting, use Download to save a file locally (JSON or the selected output extension such as .xml, .csv, .tsv, .yml, .ts, or .cs).

Import JSON from URL control in the JSON formatter
Import URL — fetch a public resource from your browser (CORS required)

8. Size calculator

The size panel reports characters, UTF-8 bytes, pretty vs minified size, key count, depth, and null counts for the current document. Use it to see how much space Minify saves before you ship a payload.

Longer walkthrough: JSON size calculator.

JSON size calculator panel with byte and minify stats
Size panel — characters, UTF-8 bytes, pretty vs minified

9. Privacy

Formatting, validation, conversion, compare, and tree browsing run in your browser. No signup is required. Import from URL contacts the remote host from your browser subject to CORS — that fetch is not proxied through Tools Viewer servers.

10. Detailed guides

Longer how-tos live as blog articles. Browse the full JSON formatter blog category, or open a post below:

JSON Formatter & Converter

JSON Formatter Online — Pretty Print Free

Format and pretty-print JSON online in your browser. Minify, validate, download .json — free JSON formatter, no signup.

Read guide
JSON Formatter & Converter

Python Dict to JSON Online — Free Converter

Convert a Python dictionary or list to JSON online. Supports True/False/None and single quotes as a best-effort paste converter — free in your browser.

Read guide
JSON Formatter & Converter

JSON Size Calculator — Bytes & Minify Savings

Calculate JSON size online: characters, UTF-8 bytes, pretty vs minified size, depth, and key counts — free in your browser.

Read guide
JSON Formatter & Converter

Convert JSON to XML Online (and XML to JSON)

Convert JSON to XML or XML to JSON online in your browser. Download the result — free converter, no signup.

Read guide
JSON Formatter & Converter

JSONL to JSON — Convert JSON Lines Online

Convert JSONL (JSON Lines / NDJSON) to a JSON array online. Format, minify, or export — free in your browser.

Read guide
JSON Formatter & Converter

Validate JSON Online — Fix Syntax Errors Fast

Validate JSON online with clear line/column errors. Fix trailing commas and quotes in your browser — free JSON validator, no signup.

Read guide
JSON Formatter & Converter

Compare JSON Online — JSON Diff Tool

Compare JSON online with a structural path-level JSON diff. Paste A and B, review added, removed, and changed values side by side — free, no signup.

Read guide
JSON Formatter & Converter

Minify JSON Online — JSON to One Line

Minify JSON online to compact one-line JSON. Compare pretty vs minified size in the size panel — free browser JSON minifier, no signup.

Read guide
JSON Formatter & Converter

Convert JSON to YAML, CSV & TSV Online

Convert JSON to YAML, CSV, or TSV online, and convert CSV input back to JSON. Best-effort browser converter for common data shapes.

Read guide
JSON Formatter & Converter

JSON Stringify Online — Escaped JSON String

Stringify JSON online into an escaped JSON string, parse strings back to JSON, or convert output to JSON string — free in your browser.

Read guide
JSON Formatter & Converter

JSON Tree Viewer Online — Browse JSON Outline

View JSON as a tree online with an outline for objects, arrays, keys, and values. Inspect nested payloads in your browser, free with no signup.

Read guide
JSON Formatter & Converter

Flatten JSON Online — Flatten & Unflatten

Flatten JSON online into dot and index paths like user.name and items[0].sku, then unflatten back to nested JSON — free in your browser.

Read guide

11. FAQ

FAQ

Is this JSON formatter free?

Yes. JSON Formatter & Converter is free on ToolsViewer with no signup. Format, validate, convert, compare, import from URL, and download in your browser.

Does the tool upload my JSON?

Formatting, validation, and conversion run in your browser. Import from URL fetches the remote resource directly from your browser to that URL — Tools Viewer does not proxy or store that content on our servers.

Which JSON tools are included?

Formatter, validator, editor/viewer, pretty print, minify / one-line, stringify, parser, sorter, compare, tree outline, flatten/unflatten, size calculator, plus converters to XML, CSV, TSV, YAML, and escaped string.

Can I convert JSON to XML, CSV, TSV, YAML, or a string?

Yes. Open Convert mode, choose the To format (XML, CSV, TSV, YAML, JSON string, and more), then run Convert.

Can I compare two JSON documents?

Yes. Compare mode shows a structural path-level report of added, removed, and changed values between JSON A and JSON B.

Does it validate JSON and show errors?

Yes. Invalid JSON shows a clear error message with line and column when the browser reports a position.

Is there a JSON size calculator?

Yes. The size panel shows characters, UTF-8 bytes, pretty vs minified size, key count, depth, and null counts for the current document.

Open JSON Formatter →