JSON & YAML Formatter and Validator

Paste JSON or YAML and the tool detects the format, checks it as you type and points to the exact line of every missing bracket, comma or quote. Format, minify, convert or compare in one click; nothing is uploaded.

Input
Output

    Nothing leaves your browser. Shortcut: Ctrl/⌘ + Enter runs the main action.

    What does this tool do?

    It is a JSON and YAML workbench that runs entirely in your browser. Paste or drop a file into the editor and it is parsed immediately: if something is wrong you get every problem with its line and column, a plain-language explanation and, for broken brackets, a guess at where the missing one belongs. When the input is valid you can pretty-print it, minify it, sort its keys, or convert JSON to YAML and back. The diff pages compare two versions of a file and show only what changed.

    Unlike most online formatters, the JSON parser here is written for diagnostics rather than speed. A browser's built-in JSON.parse stops at the first problem with a message such as Unexpected token. This parser keeps going, collects every issue in one pass, and builds a repaired version, so you can fix a whole file at once instead of one error per attempt.

    All tools

    How to format or validate JSON and YAML

    1. Paste, drop or open a file. The badge shows whether it was read as JSON or YAML, and the status line updates as you type.
    2. Read the problems list. Each entry has a button that jumps to the exact position in the editor; affected lines are highlighted in the gutter.
    3. Click Format, Minify or a conversion. Pick 2 spaces, 4 spaces or tabs and decide whether keys should be sorted.
    4. Copy or download the result, or click Use as input to keep working on it.

    The JSON errors it catches

    These are the mistakes people make most often when editing JSON by hand or copying it from JavaScript, Python or a log file. All of them are reported with a position and fixed by the Fix JSON button:

    What you wroteWhat the validator reportsValid JSON
    {"a": 1,}Trailing comma before "}"{"a": 1}
    {"a": 1 "b": 2}Missing comma after the value on line 1{"a": 1, "b": 2}
    {"a": [1, 2}Expected "]" to close the array opened on line 1{"a": [1, 2]}
    {'a': 'b'}Strings must use double quotes{"a": "b"}
    {a: 1}Property names must be in double quotes{"a": 1}
    {"n": 007, "x": .5}Leading zeros; number starts with a decimal point{"n": 7, "x": 0.5}
    {"ok": True, "v": None}Booleans and null are lowercase{"ok": true, "v": null}
    // commentComments are not allowed in JSONremove the comment

    The YAML problems it catches

    YAML errors are mostly about whitespace: tabs used for indentation, a child key indented one space too far, or key:value without a space after the colon, which YAML reads as a single string. The validator reports these with the line number and adds warnings for values that YAML 1.1 parsers such as PyYAML read differently from YAML 1.2, for example country: NO becoming false or mode: 0755 becoming an octal number.

    Privacy

    The page is static HTML and JavaScript. Nothing you paste is transmitted, stored or logged, there is no account, and the tools keep working if you disconnect from the internet after the page has loaded.

    Frequently asked questions

    Is my data sent to a server?

    No. Parsing, formatting, conversion and diffing run in JavaScript inside your browser tab. The page makes no requests with your text, so it is safe to paste configuration files, tokens in test data or customer payloads. Close the tab and everything is gone.

    How does the tool know whether my text is JSON or YAML?

    If the text starts with { [ or a double quote it is treated as JSON; otherwise it is parsed as YAML. Every JSON document is also valid YAML, so the badge above the editor shows which parser was used. The dedicated JSON and YAML pages skip the detection.

    What is the largest file I can open?

    Files up to 25 MB open directly. Validation and formatting of a few megabytes take well under a second on a laptop; very large files only slow down the live check, which waits a little longer before running.

    Why does it say "most likely cause" above the errors?

    When brackets do not balance, the error a parser reports is often far from the real mistake. The validator also looks at indentation: if a line is indented like the line that opened an object, that object was probably meant to end just before it. That guess is shown first, and Fix JSON uses it to insert the missing bracket.

    Does formatting change my data?

    No. Numbers are printed exactly as written (12345678901234567890 stays intact instead of being rounded), key order is kept unless you tick Sort keys, and duplicate keys are kept and flagged. YAML formatting keeps comments, anchors and document markers.

    Can I use it offline?

    Yes. Once the page has loaded, all tools work without a connection. You can also save the page and open it locally.