Utilo

JSON Formatter & Converter

Free JSON converter and formatter. Beautify, validate, minify, and convert JSON to YAML, CSV or TypeScript. Private and instant, with no signup.

What this JSON tool does

JSON (JavaScript Object Notation) is the default data format of web APIs, configuration files and log pipelines. Raw JSON, however, often arrives minified on a single line or slightly broken by a trailing comma. This tool parses your input with the browser's native JSON.parse, reports the exact error if the document is invalid, and re-serialises it with the indentation you choose. It also converts in both directions: JSON to YAML, CSV or TypeScript interfaces, and YAML or CSV back to JSON. Parsing runs in a Web Worker, so even multi-megabyte payloads do not freeze the page.

How to use it

  1. Paste JSON into the left panel, or click Sample to load an example.
  2. Pick a mode: Format (pretty-print), Minify, → YAML, → CSV, → TypeScript, YAML → JSON or CSV → JSON.
  3. Choose 2 spaces, 4 spaces or tabs for indentation.
  4. Read the status badge above the output: green means valid, red shows the parser message.
  5. Click Copy to put the result on your clipboard.

Practical examples

  • Debugging an API response: copy a minified body from the browser's Network tab, paste it here and format it to see the nesting at a glance.
  • Typing a fetch call: switch to → TypeScript and you get export interface Root { ... } with nested interfaces named after their keys, ready to drop into your project.
  • Sharing data with non-developers: convert an array of objects to CSV and open it in Excel or Google Sheets. Nested objects are kept as JSON strings in a single cell so no data is lost.
  • Kubernetes or GitHub Actions config: convert JSON to YAML when a tool only accepts YAML, or go the other way to validate a YAML file strictly.

Tips and edge cases

  • JSON does not allow comments, single quotes, trailing commas or NaN. If your input came from a JavaScript file, remove these first.
  • Numbers larger than 2^53 (for example 64-bit database IDs) lose precision in any JavaScript parser. Ask your API to send them as strings.
  • CSV export uses the keys of every object as columns; objects with different shapes produce empty cells rather than errors.
  • For CSV → JSON, numbers and booleans are detected automatically. Wrap a value in quotes in your CSV if you need it to stay a string.
  • Duplicate keys are legal in the grammar but only the last value survives parsing.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing, formatting and conversion all happen in your browser inside a Web Worker. Nothing is sent to a server, which makes the tool safe for tokens, customer records or internal configs.

Why does it say "Unexpected token" on valid-looking JSON?

The most common causes are a trailing comma after the last item, single-quoted strings, unquoted keys or invisible characters such as a byte order mark copied from a file. The error message includes the position so you can jump to it.

How large a file can I format?

Several megabytes work comfortably because the work runs off the main thread. Output above roughly 400 KB is truncated in the preview for responsiveness, but Copy always copies the full result.

How are TypeScript types inferred from arrays?

The tool samples up to 200 items of each array and unions their types. An array mixing objects and null becomes (Item | null)[], and an empty array becomes unknown[] because there is nothing to infer from.

Does minifying change my data?

No. Minifying only removes whitespace between tokens. String contents, number values and key order are preserved exactly.

Yes. All processing happens directly in your browser using JavaScript, Web Workers and Web APIs. Nothing you type, paste or upload is sent to our servers.