JSON Formatter & YAML

Format, minify, validate JSON and convert JSON ⇄ YAML
  • Files never leave your device
  • Runs in your browser
  • Free, no sign-up, no watermark

JSONPath: .key [0] [-1] [*] ..key [0:5] [?(@.price < 10)]

How to use JSON Formatter & YAML

Format, minify, and validate JSON, convert between JSON and YAML, and browse large documents as a collapsible tree. Everything runs in your browser, with exact line and column errors, JSONPath queries, and a lenient mode for JSON5, comments, and JSON Lines.

  1. 1

    Paste JSON or YAML into the Input box, drop a file on it, or click Open file.

  2. 2

    Pick an Output: Format, Minify, YAML, or Tree. Choose the Indent and turn on Sort keys if you want keys in alphabetical order.

  3. 3

    Optional: type a JSONPath in Query, such as $.items[*].name, to keep only the matching values.

  4. 4

    Copy the result, click Download, or click Use as input to keep working on it.

Frequently asked questions

Is my JSON uploaded anywhere?

No. Parsing, formatting, and conversion run in your browser, so the data never leaves your device. Large inputs are processed in a background worker to keep typing smooth.

Why does my JSON show an error?

The status bar gives the line and column of the first problem and often names the cause, such as a missing comma. If the input only has comments, trailing commas, or single quotes, click Turn on lenient parsing.

Can it read JSON5, JSONC, or JSON Lines?

Yes, with Lenient parsing on. It accepts comments, trailing commas, single quotes, unquoted keys, NaN, and one value per line. The output is always strict JSON, and JSON Lines become a single array.

Do large integers like IDs lose precision?

No. Integers beyond 2^53 are kept exactly as written, so 64-bit IDs survive formatting and minifying unchanged.

How do I find the path to a nested value?

Switch Output to Tree, click the value, then use Copy path. Query this path sends that path to the Query box.

What happens to YAML with several documents?

Documents separated by --- are combined into one array, and a note under the output tells you so.