JSON Formatter

Format, validate, inspect, and convert JSON directly in your browser.

JSON input

Result

Paste or load JSON, then choose Apply to display the Tree, Grid, and Raw views.

Convert result

What this tool does

Check pasted, sampled, or locally loaded JSON, choose its indentation, and inspect it as a searchable tree, grid, or raw text. Fullscreen views, downloads, and local CSV/XML conversion support longer editing tasks. A single JSON-LD script block can also be extracted safely.

How to use the JSON Formatter

  1. Paste JSON, load a local .json file, or insert the sample, then edit the source if needed.
  2. Choose Apply to validate the input and update the Result.
  3. Inspect or search the Tree, Grid, or Raw view; expand or collapse the Tree as needed.
  4. Choose the Result indentation and use Format, Minify, copy, download, or convert to CSV or XML.

Data handling

File reading, JSON-LD extraction, parsing, formatting, searching, conversion, copying, and downloading happen locally in your browser. fourwww does not receive the JSON, and the tool does not save it or maintain a history.

Technical scope and limitations

  • Input and local files are limited to 2 MiB of UTF-8 text to protect browser responsiveness.
  • Formatting changes whitespace and uses the selected indentation; original indentation is not preserved.
  • Duplicate object keys are not preserved. Native JSON parsing keeps the last value for a duplicate key.
  • Grid and CSV suit tabular structures such as arrays of objects; nested values stay as concise JSON instead of being flattened.
  • JSON → XML uses json/object/property, array/item, and typed scalar elements; object keys are stored in escaped name attributes.
  • Exactly one JSON-LD script block can be extracted; multiple blocks are rejected rather than combined.
  • Parse wording and the availability of exact line and column details can differ between browsers.
  • Fullscreen availability depends on browser support.
  • Comments, trailing commas, unquoted keys, NaN, and Infinity are not valid JSON.
  • Extremely deep JSON may exceed browser parsing, serialization, conversion, or tree-rendering limits even when it is within the input-size limit.

Frequently asked questions

Is my JSON uploaded?

No. The JSON is parsed and transformed locally in your browser and is not uploaded to fourwww.

Does the tool accept a single JSON value?

Yes. A string, number, boolean, or null is valid when it is valid JSON, as are objects and arrays.

Why did formatting change the whitespace?

JSON whitespace does not change its data values. Formatting recreates the document with consistent two-space indentation.

Why is only one duplicate key retained?

Native JSON parsing resolves duplicate object keys by retaining the last value. Use unique keys when data must be preserved.

What can be converted to CSV?

Arrays of objects, object collections, and flat objects can be converted. Nested values remain JSON text within their CSV cells.

How is JSON converted to XML?

Objects become property elements with escaped name attributes, arrays become item elements, and scalar values use explicit string, number, boolean, or null elements.