How to Format HTML in VS Code

Published: January 15, 2026 Author: HTML Beautifier Team Reading Time: ~1 min read
Published on: | By Web Dev Team

While online beautifiers are great for quick snippets, your primary editor should also handle formatting. Here is how to format HTML in VS Code.

Built-in Formatting

VS Code comes with a built-in HTML formatter. Simply press Shift+Alt+F (Windows) or Shift+Option+F (Mac) to format the current document.

Format on Save

Open your settings and search for "Format on Save". Enable this option to automatically beautify your HTML every time you hit Ctrl+S.

Using Extensions

For more advanced formatting rules, install the Prettier extension. It acts as an aggressive, opinionated formatter that ensures ultimate consistency.

Try our HTML Beautifier now