1. Select File -> Preferences -> Settings (Ctrl + comma) and search form formatter
  2. 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

Answer from Miha on Stack Overflow
🌐
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.
People also ask

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
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-prettier-in-visual-studio-code
How To Use Prettier in Visual Studio Code
March 18, 2024 - When your Prettier extension is installed, you need to configure Visual Studio Code to take advantage of it. You can do in the Settings tab. Side node: to open the Settings tab, you can use COMMAND + , on macOS or CTRL + , on Windows and Linux:
🌐
TMS Outsource
tms-outsource.com › home › how to use prettier in vscode to format code
How to Use Prettier in VSCode to Format Code
December 18, 2025 - Navigate to File > Preferences > Settings (or press Ctrl+,), search for “Default Formatter” in the search bar, then select “esbenp.prettier-vscode” from the dropdown menu to make Prettier handle all code formatting tasks.
🌐
Robin Wieruch
robinwieruch.de › how-to-use-prettier-vscode
How to use Prettier in VS Code - Robin Wieruch
February 14, 2022 - How to install Prettier for VS Code (Visual Studio Code). Install Prettier, configure it globally to format on save, add further Prettier configuration on a global level, and use a local .prettierrc file ...
🌐
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%
Find elsewhere
🌐
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.
Price   $
Address   1999 Harrison St 1800 9079, 94612, Oakland
🌐
Educative
educative.io › answers › how-to-set-up-prettier-and-automatic-formatting-on-vs-code
How to set up Prettier and automatic formatting on VS Code
Click on the “extension logo” from the left sidebar and type “Prettier” in the search bar. Next, click on the “Install” button. ... Once found, click on it to proceed to installation.
🌐
SheCodes
shecodes.io › athena › 9830-how-to-use-prettier-in-vs-code
[VS Code] - How to Use Prettier in VS Code - SheCodes | SheCodes
Learn how to use Prettier in Visual Studio Code by checking the extention installation, enabling and configuring it. Follow these steps to get your set up!
🌐
Medium
masukmia.medium.com › how-to-install-and-configure-prettier-in-vscode-for-seamless-code-formatting-f7893a771066
How to Install and Configure Prettier in VSCode for Seamless Code Formatting | by Masuk Mia | Medium
October 13, 2024 - Press Ctrl+, (Windows/Linux) or Cmd+, (Mac) to open Settings. In the search bar, type default formatter. Under Editor: Default Formatter, select Prettier — Code formatter from the dropdown menu.
🌐
OpenReplay
blog.openreplay.com › using-prettier-with-vscode-to-write-javascript
Using Prettier with VSCode to write JavaScript
Open your VSCode user settings by clicking “Preferences: Open User Settings” in the Command Palette (Ctrl+Shift+P on Windows/Linux or Cmd+Shift+P on Mac). In the settings editor, search for Prettier and click Edit in settings.json.
🌐
Alphr
alphr.com › home › how to use prettier in vs code
How To Use Prettier in VS Code
July 18, 2022 - This process will also work on your CSS files. Open the VS Code Settings menu by tapping “Command + ,(comma)” if you use a Mac. Click on “Control + ,(comma)”, if you are a Windows user.
🌐
Caasify
caasify.com › blog › prettier-vs-code-setup-a-complete-guide-to-code-formatting-and-automation
A Complete Guide to Code Formatting and Automation
September 26, 2025 - To open the command palette, press ... + P on Windows. In the command palette, search for “format” and choose Format Document. You might be asked to choose a formatter. Click Configure and then select Prettier – Code Formatter.
🌐
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
🌐
Adam the Automator
adamtheautomator.com › prettier-vscode
Enhance Your IT Scripting with the Prettier VSCode Plugin
... 3. Now, right-click on a blank space and select Format Document With in the context menu, which opens the command palette. ... Prettier keeps all codes in one line. Removes white spaces.
Published   October 4, 2022
🌐
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).