Right-click in your text editing area and choose Format Document With.... A popup will appear on top then choose Choose default formatter and then choose Prettier

Answer from Ayush Gupta on Stack Overflow
🌐
Visual Studio Code
code.visualstudio.com › docs › languages › html
HTML in Visual Studio Code
November 3, 2021 - Visual Studio Code provides basic support for HTML programming out of the box. There is syntax highlighting, smart completions with IntelliSense, and customizable formatting.
Discussions

Help with formatting of my HTML files in VS Code
For some reason, the paragraph content in my HTML files is breaking into multiple lines in VS Code. I made the mistake of making changes to my settings based on a video I watched. I thought I undid the changes I made, but maybe I missed something. And that is assuming the change in the editor ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
December 4, 2021
formatting - How to format HTML code in VScode ? - Stack Overflow
I would like to find a way to format HTML in VScode, such as fro example, if I have a long div like this one: More on stackoverflow.com
🌐 stackoverflow.com
Format on save messes up original HTML file format
VSCode Version: 1.28.2 (1.28.2) OS Version: macOS Mojave 10.14.1 Windows 10 x64 Steps to Reproduce: Create new or edit an existing HTML file with new lines and indenting Save HTML file with Format ... More on github.com
🌐 github.com
15
October 10, 2018
HTML Formatter for Visual Studio?
What’s wrong with CTRL K D to format the document, VS 2022 formats pretty well with that command. More on reddit.com
🌐 r/Blazor
11
3
December 30, 2023
🌐
Tim Deschryver
timdeschryver.dev › blog › my-recommendations-to-configure-visual-studio-code-for-angular-development
My recommendations to configure Visual Studio Code for Angular Development
2 days ago - The result is a consistent linting experience across your entire project, including your TypeScript and HTML files. ... To integrate ESLint with Angular, I refer you to the Angular ESLint project. Many teams use Prettier to enforce a consistent code style. Install this extension to format your code using the Prettier code formatter. Within the next section, I'll show you how to configure VSCode to format your code automatically when a file is saved.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Prettier - Code formatter - Visual Studio Marketplace
January 21, 2026 - Extension for Visual Studio Code - Code formatter using prettier
Find elsewhere
🌐
Medium
thiraphat-ps-dev.medium.com › the-best-code-formatters-for-vs-code-11704e787f92
The Best Code Formatters for VS Code | by Thiraphat Phutson | Medium
June 3, 2024 - Integration: Easily integrates with VS Code for a seamless formatting experience. ... Open the Extensions view (Ctrl+Shift+X). Search for “Beautify” and install it. Add the following settings in your settings.json to configure Beautify: "editor.formatOnSave": true, "beautify.language": { "js": { "type": [ "javascript", "json" ], "filename": [ ".jshintrc", ".jsbeautifyrc" ] }, "css": ["css", "scss"], "html": ["htm", "html"] }
🌐
freeCodeCamp
forum.freecodecamp.org › t › help-with-formatting-of-my-html-files-in-vs-code › 487585
Help with formatting of my HTML files in VS Code - The freeCodeCamp Forum
December 4, 2021 - For some reason, the paragraph content in my HTML files is breaking into multiple lines in VS Code. I made the mistake of making changes to my settings based on a video I watched. I thought I undid the changes I made, but maybe I missed something. And that is assuming the change in the editor ...
🌐
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 - Note: If you do not see a prompt for selecting a default formatter, you can manually set Prettier as the default formatter in VS Code. Open your Settings and set Editor: Default Formatter to esbenp.prettier-vscode.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Pretty Formatter - Visual Studio Marketplace
Extension for Visual Studio Code - VS Code extension to format your code using Pretty Diff
🌐
CSS-Tricks
css-tricks.com › vs-code-extensions-for-html
VS Code Extensions for HTML | CSS-Tricks
June 7, 2021 - Let's look at some extensions for VS Code that make writing and editing HTML (and languages that are basically HTML with extra powers) better. You may not
🌐
YouTube
youtube.com › watch
Code Formatting Extensions in VSCode - YouTube
This brief tutorial is generally about being productive and forming good habits. Specifically, it is about using the Prettier VSCode extension to help you fo...
Published   January 8, 2020
🌐
Medium
medium.com › @karimhasibuan › how-to-force-prettier-html-formatting-to-format-tags-in-one-line-this-is-it-f0bf2a50a5b0
How to Force Prettier HTML Formatting to Format Tags in One Line? This is it! | by Karim Hasibuan | Medium
November 28, 2022 - Yap, that is to SOLVE How to Force Prettier HTML Formatting to Format Tags in One Line? Hope it can help you. Happy Work :) REFERENCE: [1] https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode · [2] https://stackoverflow.com/questions/53342961/how-to-force-prettier-html-formatting-to-format-tags-in-one-line ·
🌐
GitHub
github.com › microsoft › vscode › issues › 62996
Format on save messes up original HTML file format · Issue #62996 · microsoft/vscode
October 10, 2018 - VSCode Version: 1.28.2 (1.28.2) OS Version: macOS Mojave 10.14.1 Windows 10 x64 Steps to Reproduce: Create new or edit an existing HTML file with new lines and indenting Save HTML file with Format on Save active Most of the time the VSCo...
Published   Nov 13, 2018
🌐
iorad
iorad.com › player › 1691840 › Change-Visual-Studio-Code-Default-Settings-for-HTML-Formatting---Auto-Format-Code-After-Changing
Change Visual Studio Code Default Settings for HTML Formatting - Auto-Format Code After Changing
The first step is to open Visual Studio Code and click File. Highlight Preferences and Click Settings. Click Extensions. Click HTML to change settings for HTML files. Click "Edit in settings.json".
🌐
Visual Studio Code
code.visualstudio.com › docs › editing › codebasics
Basic editing
November 3, 2021 - VS Code has default formatters for JavaScript, TypeScript, JSON, HTML, and CSS.
🌐
Alphr
alphr.com › home › how to auto-format code in vs code
How To Auto-Format Code in VS Code
June 8, 2022 - Click the “Default Formatter” option and select “Prettier” from the list. Scroll down a bit until you see the “Editor: Format On Save” option. Check the box next to this option.
🌐
FreeFormatter
freeformatter.com › html-formatter.html
Free Online HTML Formatter - FreeFormatter.com
This free online HTML formatter and validator lets you chose your indentation level and also lets you export to file