Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>YAJFNew to Visual Studio Code? Get it now.
YAJF

YAJF

itoleck

| (0) | Free
Json - Pretty, Ugly/Min, Newline Items, Newline Properties. By file and selection.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

YAJF — Yet Another JSON Formatter

A Visual Studio Code extension that formats .json (and .jsonc) files four different ways, on the whole document or just the current selection.

Formatting modes

Mode Description
JSON: Pretty Fully indented — each object property and each array item on its own line.
JSON: Ugly / Minimize Compact, single line, no whitespace.
JSON: Newline After Each Item Array items are expanded onto their own lines; objects stay inline.
JSON: Newline After Each Property Object properties are expanded onto their own lines; arrays stay inline.
JSON: Validate Document Validate the JSON, document only.

Each mode, except Validate has two variants:

  • Format Document — reformats the entire file.
  • Format Selection — reformats only the selected text (must be valid JSON on its own).

Usage

  1. Open a JSON file.
  2. Right-click in the editor and pick one of the YAJF commands, or
  3. Open the Command Palette (Ctrl+Shift+P) and search for YAJF.

Selection commands appear in the right-click menu only when text is selected.

Indentation follows the editor's Insert Spaces / Tab Size settings.

Example

Input:

{"name":"test","tags":["a","b"],"info":{"x":1,"y":2}}

Pretty

{
    "name": "test",
    "tags": [
        "a",
        "b"
    ],
    "info": {
        "x": 1,
        "y": 2
    }
}

Ugly / Minimize

{"name":"test","tags":["a","b"],"info":{"x":1,"y":2}}

Newline After Each Item

{"name":"test","tags":[
    "a",
    "b"
],"info":{"x":1,"y":2}}

Newline After Each Property

{
    "name": "test",
    "tags": ["a","b"],
    "info": {
        "x": 1,
        "y": 2
    }
}

Requirements

VS Code ^1.85.0.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft