- Select
File -> Preferences -> Settings(Ctrl+comma) and search formformatter - Set Prettiers as Default formatter.

If above does not work:
ctrl+shift+p > Format Document With... > Configure Default Formatter... > Prettier - Code formatter
This also work with ctrl+shift+I
DigitalOcean
digitalocean.com › community › tutorials › how-to-format-code-with-prettier-in-visual-studio-code
Format Code with Prettier in Visual Studio Code: Setup Guide | DigitalOcean
August 1, 2025 - To open the command palette, press ... + P on Windows. In the command palette, search for format and then choose Format Document. You may then be prompted to choose a formatter. Click the Configure button: Then, select Prettier – Code Formatter. Note: If you do not see a prompt for selecting ...
Prettier
prettier.io › docs › editors
Editor Integration · Prettier
Note! It’s important to install Prettier locally in every project, so each project gets the correct Prettier version. prettier-vscode can be installed using the extension sidebar – it’s called “Prettier - Code formatter.” Check its repository for configuration and shortcuts.
Videos
02:11
How to use Prettier in VS Code - Code Formatting - YouTube
13:37
How to Setup Prettier in VSCode and Format your Project - YouTube
12:11
How To Setup Prettier - YouTube
05:18
Install Prettier on VSCode | Set Up and Configure Prettier | Code ...
02:06
Install Prettier on VSCode | Set Up and configure Prettier - ...
14:25
How to Use Prettier with VS Code! (2026 Full Tutorial) - YouTube
Does Prettier work with TypeScript?
Yes. Prettier fully supports TypeScript files including .ts and .tsx. It formats type annotations, interfaces, generics, and other TypeScript syntax automatically.
tms-outsource.com
tms-outsource.com › home › how to use prettier in vscode to format code
How to Use Prettier in VSCode to Format Code
Why is Prettier not formatting on save?
Ensure Editor: Format On Save is enabled and Editor: Default Formatter is set to esbenp.prettier-vscode. If both are correct, reload VSCode using Developer: Reload Window from the Command Palette.
tms-outsource.com
tms-outsource.com › home › how to use prettier in vscode to format code
How to Use Prettier in VSCode to Format Code
How do I fix Prettier and ESLint conflicts?
Install eslint-config-prettier and add prettier as the last item in your ESLint extends array. This disables ESLint formatting rules that conflict with Prettier.
tms-outsource.com
tms-outsource.com › home › how to use prettier in vscode to format code
How to Use Prettier in VSCode to Format Code
Visual Studio Marketplace
marketplace.visualstudio.com › items
Prettier - Code formatter - Visual Studio Marketplace
Extension for Visual Studio Code - Code formatter using prettier
GitHub
github.com › prettier › prettier-vscode
GitHub - prettier/prettier-vscode: Visual Studio Code extension for Prettier · GitHub
A better option for global defaults is to put a ~/.prettierrc file in your home directory. ... Supply a custom path to the prettier module. This path should be to the module folder, not the bin/script path. i.e. ./node_modules/prettier, not ./bin/prettier. ... When enabled, this extension will attempt to use global npm or yarn modules if local modules cannot be resolved. NOTE: This setting can have a negative performance impact, particularly on Windows when you have attached network drives.
Starred by 5.5K users
Forked by 509 users
Languages TypeScript 78.3% | JavaScript 20.3% | PHP 0.6% | Dockerfile 0.3% | HTML 0.3% | SCSS 0.1%
Hostman
hostman.com › tutorials › how to format code with prettier in visual studio code
How to Format Code Using Prettier in Visual Studio Code
October 20, 2025 - Open the Extensions tab in the VS Code menu (or press Ctrl + Shift + X on Windows). Search for Prettier.
Top answer 1 of 16
1399
- Select
File -> Preferences -> Settings(Ctrl+comma) and search formformatter - Set Prettiers as Default formatter.

If above does not work:
ctrl+shift+p > Format Document With... > Configure Default Formatter... > Prettier - Code formatter
This also work with ctrl+shift+I
2 of 16
565
If doing what @Simin Maleki mentioned does not solve it for you, there is a chance that your default formatter is not set:
File > Preferences > Settings > Search for "default formatter"
Make sure your Editor: Default Formatter field is not null but rather Prettier - Code formatter (esbenp.prettier-vscode) and that all the languages below are ticked. This fixed my issue.
STEP BY STEP WALKTHROUGH

Also make sure that your format on save is enabled:

SheCodes
shecodes.io › athena › 1125-how-to-install-and-use-prettier-in-vs-code
[VS Code] - How to Install and Use Prettier in VS Code - | SheCodes
Learn how to install Prettier in VS Code and further details on how to enable it for JavaScript files
HumanKode
humankode.com › javascript › set-up-prettier-and-vs-code-to-format-your-code
Set up Prettier and VS Code to Format Your Code
March 28, 2025 - Install the prettier extension for VS Code here: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode · Create a .prettierrc file and place it in the root of your project. .prettierrc · { "semi": true, "trailingComma": "all", "singleQuote": true, "printWidth": 80, "endOfLine": "auto" } Open the user settings JSON file by entering the keyboard shortcut CMD + Shift + P on Mac or Ctrl + Shift + P on Windows, then type in user settings, and select Preferences: Open User Settings (JSON).


